[#4180] Hide the full total input and clear it on changes.

This commit is contained in:
Eric Davis
2010-07-02 11:22:58 -07:00
parent 545c2e06e5
commit 766072fb36
2 changed files with 9 additions and 4 deletions
+4 -2
View File
@@ -3,9 +3,11 @@ jQuery(function($) {
var deliverableType = $('select#deliverable_type option:selected').val();
if (deliverableType == 'FixedDeliverable') {
$('#deliverable_total').show();
$('#deliverable_total_input').show();
} else {
$('#deliverable_total').hide();
$('#deliverable_total_input').
children('#deliverable_total').val('').end().
hide();
}
},
+5 -2
View File
@@ -91,9 +91,10 @@ class DeliverablesNewTest < ActionController::IntegrationTest
fill_in "End Date", :with => '2010-12-31'
fill_in "Notes", :with => 'Some notes on the deliverable'
assert js("jQuery('#deliverable_total').is(':hidden')"),
# Hide and clear the total
assert js("jQuery('#deliverable_total_input').is(':hidden')"),
"Total is visible when it should be hidden"
click_button "Save"
assert_response :success
@@ -106,6 +107,8 @@ class DeliverablesNewTest < ActionController::IntegrationTest
assert_equal '2010-01-01', @deliverable.start_date.to_s
assert_equal '2010-12-31', @deliverable.end_date.to_s
assert_equal @manager, @deliverable.manager
assert_equal nil, @deliverable.total
end
end