@@ -706,8 +706,12 class IssueTest < ActiveSupport::TestCase | |||
|
706 | 706 | |
|
707 | 707 | def test_read_only_attribute_names_for_multiple_roles_should_intersect_rules |
|
708 | 708 | WorkflowPermission.delete_all |
|
709 |
WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, |
|
|
710 | WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, :role_id => 1, :field_name => 'start_date', :rule => 'readonly') | |
|
709 | WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, | |
|
710 | :role_id => 1, :field_name => 'due_date', | |
|
711 | :rule => 'readonly') | |
|
712 | WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, | |
|
713 | :role_id => 1, :field_name => 'start_date', | |
|
714 | :rule => 'readonly') | |
|
711 | 715 | user = User.find(2) |
|
712 | 716 | member = Member.find(1) |
|
713 | 717 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1) |
@@ -718,7 +722,9 class IssueTest < ActiveSupport::TestCase | |||
|
718 | 722 | member.save! |
|
719 | 723 | assert_equal [], issue.read_only_attribute_names(user.reload) |
|
720 | 724 | |
|
721 |
WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, |
|
|
725 | WorkflowPermission.create!(:old_status_id => 1, :tracker_id => 1, | |
|
726 | :role_id => 2, :field_name => 'due_date', | |
|
727 | :rule => 'readonly') | |
|
722 | 728 | assert_equal %w(due_date), issue.read_only_attribute_names(user) |
|
723 | 729 | end |
|
724 | 730 |
General Comments 0
You need to be logged in to leave comments.
Login now