[#4180] Hide the full total input and clear it on changes.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user