Don't use assert_equal nil.

git-svn-id: http://svn.redmine.org/redmine/trunk@16064 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-12-12 21:36:14 +00:00
parent 167a4b8005
commit 3186130966
6 changed files with 31 additions and 10 deletions

View File

@@ -356,6 +356,7 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
test "GET /issues/:id.xml should contains total_estimated_hours and total_spent_hours" do
parent = Issue.find(3)
parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
TimeEntry.create!(:project => child.project, :issue => child, :user => child.author, :spent_on => child.author.today,
:hours => '2.5', :comments => '', :activity_id => TimeEntryActivity.first.id)
@@ -372,6 +373,7 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
test "GET /issues/:id.xml should contains total_estimated_hours, and should not contains spent_hours and total_spent_hours when permission does not exists" do
parent = Issue.find(3)
parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
# remove permission!
Role.anonymous.remove_permission! :view_time_entries
@@ -389,6 +391,7 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
test "GET /issues/:id.json should contains total_estimated_hours and total_spent_hours" do
parent = Issue.find(3)
parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
TimeEntry.create!(:project => child.project, :issue => child, :user => child.author, :spent_on => child.author.today,
:hours => '2.5', :comments => '', :activity_id => TimeEntryActivity.first.id)
@@ -404,6 +407,7 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
test "GET /issues/:id.json should contains total_estimated_hours, and should not contains spent_hours and total_spent_hours when permission does not exists" do
parent = Issue.find(3)
parent.update_columns :estimated_hours => 2.0
child = Issue.generate!(:parent_issue_id => parent.id, :estimated_hours => 3.0)
# remove permission!
Role.anonymous.remove_permission! :view_time_entries