GitLab wurde erfolgreich aktualisiert. Durch regelmäßige Updates bleibt das THM GitLab sicher. Danke für Ihre Geduld.

Commit d54899b3 authored by tmaruyama's avatar tmaruyama

code layout clean up...

code layout clean up test_safe_attributes_should_accept_target_tracker_writable_fields of unit issue test

git-svn-id: https://svn.redmine.org/redmine/trunk@10642 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 020cc95c
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment