diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-25 08:37:54 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-25 08:37:54 +0000 |
commit | a3efaceb8fd9e0aa10bd5601662b77a34ea462e5 (patch) | |
tree | 915e7c3879c0052e478a1a0664b8000bba414cdb /test/functional | |
parent | 2f51dc11cfdf9cdbd2c67ec12cf93f4b112646bc (diff) | |
download | redmine-a3efaceb8fd9e0aa10bd5601662b77a34ea462e5.tar.gz redmine-a3efaceb8fd9e0aa10bd5601662b77a34ea462e5.zip |
Redirect to custom field after create or update.
git-svn-id: http://svn.redmine.org/redmine/trunk@14746 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/custom_fields_controller_test.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/functional/custom_fields_controller_test.rb b/test/functional/custom_fields_controller_test.rb index 046de87bd..a4d9f015d 100644 --- a/test/functional/custom_fields_controller_test.rb +++ b/test/functional/custom_fields_controller_test.rb @@ -139,7 +139,7 @@ class CustomFieldsControllerTest < ActionController::TestCase end def test_create_list_custom_field - assert_difference 'CustomField.count' do + field = new_record(IssueCustomField) do post :create, :type => "IssueCustomField", :custom_field => {:name => "test_post_new_list", :default_value => "", @@ -154,9 +154,8 @@ class CustomFieldsControllerTest < ActionController::TestCase :field_format => "list", :tracker_ids => ["1", ""]} end - assert_redirected_to '/custom_fields?tab=IssueCustomField' - field = IssueCustomField.find_by_name('test_post_new_list') - assert_not_nil field + assert_redirected_to "/custom_fields/#{field.id}/edit" + assert_equal "test_post_new_list", field.name assert_equal ["0.1", "0.2"], field.possible_values assert_equal 1, field.trackers.size end @@ -202,7 +201,7 @@ class CustomFieldsControllerTest < ActionController::TestCase def test_update put :update, :id => 1, :custom_field => {:name => 'New name'} - assert_redirected_to '/custom_fields?tab=IssueCustomField' + assert_redirected_to '/custom_fields/1/edit' field = CustomField.find(1) assert_equal 'New name', field.name |