diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-10-13 10:52:31 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2012-10-13 10:52:31 +0000 |
commit | 7a162b725597acca3ba007335c266395beb5e540 (patch) | |
tree | 05a9d58f65d3e4f817d4bdb74956840481b1cd8d /test/unit/issue_test.rb | |
parent | 9da555fcb77159e7198ed1852c7322390e79990a (diff) | |
download | redmine-7a162b725597acca3ba007335c266395beb5e540.tar.gz redmine-7a162b725597acca3ba007335c266395beb5e540.zip |
code layout clean up test_safe_attributes_should_accept_target_tracker_writable_fields of unit issue test
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10642 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 77a59c19a..2763b2f0e 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -565,17 +565,24 @@ class IssueTest < ActiveSupport::TestCase def test_safe_attributes_should_accept_target_tracker_writable_fields WorkflowPermission.delete_all - WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'due_date', :rule => 'readonly') - WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, :role_id => 1, :field_name => 'start_date', :rule => 'readonly') + WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, + :role_id => 1, :field_name => 'due_date', + :rule => 'readonly') + WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 2, + :role_id => 1, :field_name => 'start_date', + :rule => 'readonly') user = User.find(2) issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1) - issue.send :safe_attributes=, {'start_date' => '2012-07-12', 'due_date' => '2012-07-14'}, user + issue.send :safe_attributes=, {'start_date' => '2012-07-12', + 'due_date' => '2012-07-14'}, user assert_equal Date.parse('2012-07-12'), issue.start_date assert_nil issue.due_date - issue.send :safe_attributes=, {'start_date' => '2012-07-15', 'due_date' => '2012-07-16', 'tracker_id' => 2}, user + issue.send :safe_attributes=, {'start_date' => '2012-07-15', + 'due_date' => '2012-07-16', + 'tracker_id' => 2}, user assert_equal Date.parse('2012-07-12'), issue.start_date assert_equal Date.parse('2012-07-16'), issue.due_date end |