Preserve field values on bulk edit failure (#13943).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11787 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2013-05-04 15:03:07 +00:00
parent 1269e6c7d3
commit 70bdb86c53
6 changed files with 63 additions and 29 deletions

View File

@@ -3616,6 +3616,18 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal [issue1.id, issue2.id], assigns[:issues].map(&:id)
end
def test_bulk_update_with_failure_should_preserved_form_values
@request.session[:user_id] = 2
post :bulk_update, :ids => [1, 2], :issue => {:tracker_id => '2', :start_date => 'foo'}
assert_response :success
assert_template 'bulk_edit'
assert_select 'select[name=?]', 'issue[tracker_id]' do
assert_select 'option[value=2][selected=selected]'
end
assert_select 'input[name=?][value=?]', 'issue[start_date]', 'foo'
end
def test_get_bulk_copy
@request.session[:user_id] = 2
get :bulk_edit, :ids => [1, 2, 3], :copy => '1'