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

Commit 86d7dd18 authored by tmaruyama's avatar tmaruyama

code layout clean up test_new_statuses_allowed_to of unit issue test

git-svn-id: https://svn.redmine.org/redmine/trunk@10643 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent d54899b3
......@@ -410,26 +410,39 @@ class IssueTest < ActiveSupport::TestCase
def test_new_statuses_allowed_to
WorkflowTransition.delete_all
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 2, :author => false, :assignee => false)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4, :author => false, :assignee => true)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
:old_status_id => 1, :new_status_id => 2,
:author => false, :assignee => false)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
:old_status_id => 1, :new_status_id => 3,
:author => true, :assignee => false)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1,
:new_status_id => 4, :author => false,
:assignee => true)
WorkflowTransition.create!(:role_id => 1, :tracker_id => 1,
:old_status_id => 1, :new_status_id => 5,
:author => true, :assignee => true)
status = IssueStatus.find(1)
role = Role.find(1)
tracker = Tracker.find(1)
user = User.find(2)
issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1)
issue = Issue.generate!(:tracker => tracker, :status => status,
:project_id => 1, :author_id => 1)
assert_equal [1, 2], issue.new_statuses_allowed_to(user).map(&:id)
issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user)
issue = Issue.generate!(:tracker => tracker, :status => status,
:project_id => 1, :author => user)
assert_equal [1, 2, 3, 5], issue.new_statuses_allowed_to(user).map(&:id)
issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author_id => 1, :assigned_to => user)
issue = Issue.generate!(:tracker => tracker, :status => status,
:project_id => 1, :author_id => 1,
:assigned_to => user)
assert_equal [1, 2, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
issue = Issue.generate!(:tracker => tracker, :status => status, :project_id => 1, :author => user, :assigned_to => user)
issue = Issue.generate!(:tracker => tracker, :status => status,
:project_id => 1, :author => user,
:assigned_to => user)
assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id)
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