diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-15 10:25:14 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-12-15 10:25:14 +0000 |
commit | f303000580d031e9f5e2419d7993c98e0345bb12 (patch) | |
tree | 2e9c98112831cd14667a0f5cb42455f35f8b4f0e /test/functional/issue_statuses_controller_test.rb | |
parent | f92141decbf20e84dfbe73b7ebdc99004885582d (diff) | |
download | redmine-f303000580d031e9f5e2419d7993c98e0345bb12.tar.gz redmine-f303000580d031e9f5e2419d7993c98e0345bb12.zip |
Do not change settings in tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8224 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/issue_statuses_controller_test.rb')
-rw-r--r-- | test/functional/issue_statuses_controller_test.rb | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/test/functional/issue_statuses_controller_test.rb b/test/functional/issue_statuses_controller_test.rb index 478e14272..33519de61 100644 --- a/test/functional/issue_statuses_controller_test.rb +++ b/test/functional/issue_statuses_controller_test.rb @@ -82,26 +82,19 @@ class IssueStatusesControllerTest < ActionController::TestCase assert_not_nil IssueStatus.find_by_id(1) end - context "on POST to :update_issue_done_ratio" do - context "with Setting.issue_done_ratio using the issue_field" do - setup do - Setting.issue_done_ratio = 'issue_field' - post :update_issue_done_ratio - end - - should_set_the_flash_to /not updated/ - should_redirect_to('the index') { '/issue_statuses' } + def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_field + with_settings :issue_done_ratio => 'issue_field' do + post :update_issue_done_ratio + assert_match /not updated/, flash[:error].to_s + assert_redirected_to '/issue_statuses' end + end - context "with Setting.issue_done_ratio using the issue_status" do - setup do - Setting.issue_done_ratio = 'issue_status' - post :update_issue_done_ratio - end - - should_set_the_flash_to /Issue done ratios updated/ - should_redirect_to('the index') { '/issue_statuses' } + def test_update_issue_done_ratio_with_issue_done_ratio_set_to_issue_status + with_settings :issue_done_ratio => 'issue_status' do + post :update_issue_done_ratio + assert_match /Issue done ratios updated/, flash[:notice].to_s + assert_redirected_to '/issue_statuses' end end - end |