code layout clean up test_read_only_attribute_names_for_multiple_roles_should_intersect_rules of unit issue test

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10649 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2012-10-13 11:18:16 +00:00
parent 8487a3e0e6
commit eedad03141
1 changed files with 9 additions and 3 deletions

View File

@ -706,8 +706,12 @@ class IssueTest < ActiveSupport::TestCase
def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules
WorkflowPermission.delete_all 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 => 1,
WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly') :role_id => 1, :field_name => 'due_date',
:rule => 'readonly')
WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1,
:role_id => 1, :field_name => 'start_date',
:rule => 'readonly')
user = User.find(2) user = User.find(2)
member = Member.find(1) member = Member.find(1)
issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1) issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1)
@ -718,7 +722,9 @@ class IssueTest < ActiveSupport::TestCase
member.save! member.save!
assert_equal [], issue.read_only_attribute_names(user.reload) assert_equal [], issue.read_only_attribute_names(user.reload)
WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 2, :field_name => 'due_date', :rule => 'readonly') WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1,
:role_id => 2, :field_name => 'due_date',
:rule => 'readonly')
assert_equal %w(due_date), issue.read_only_attribute_names(user) assert_equal %w(due_date), issue.read_only_attribute_names(user)
end end