summaryrefslogtreecommitdiffstats
path: root/test/integration
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-20 16:02:38 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-12-20 16:02:38 +0000
commit5dd1fe1345f43c1cd602d611c8a799f6ce59c298 (patch)
tree83a464f09554d599a624af3aa680f1fe060acf2d /test/integration
parent21a847d01d9e950e5712aab04052e06275fa1baa (diff)
downloadredmine-5dd1fe1345f43c1cd602d611c8a799f6ce59c298.tar.gz
redmine-5dd1fe1345f43c1cd602d611c8a799f6ce59c298.zip
Merged r16059, r16060, r16064, r16072.
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@16106 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/admin_test.rb2
-rw-r--r--test/integration/api_test/issues_test.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/test/integration/admin_test.rb b/test/integration/admin_test.rb
index 22a675a71..1884645ab 100644
--- a/test/integration/admin_test.rb
+++ b/test/integration/admin_test.rb
@@ -48,7 +48,7 @@ class AdminTest < Redmine::IntegrationTest
put "/users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED }
assert_redirected_to "/users/#{ user.id }/edit"
locked_user = User.try_to_login("psmith", "psmith09")
- assert_equal nil, locked_user
+ assert_nil locked_user
end
test "Add a user as an anonymous user should fail" do
diff --git a/test/integration/api_test/issues_test.rb b/test/integration/api_test/issues_test.rb
index c21d2ccb9..4bdfff1bc 100644
--- a/test/integration/api_test/issues_test.rb
+++ b/test/integration/api_test/issues_test.rb
@@ -359,6 +359,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)
@@ -375,6 +376,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
@@ -392,6 +394,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)
@@ -407,6 +410,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
@@ -417,8 +421,8 @@ class Redmine::ApiTest::IssuesTest < Redmine::ApiTest::Base
json = ActiveSupport::JSON.decode(response.body)
assert_equal parent.estimated_hours, json['issue']['estimated_hours']
assert_equal (parent.estimated_hours.to_f + 3.0), json['issue']['total_estimated_hours']
- assert_equal nil, json['issue']['spent_hours']
- assert_equal nil, json['issue']['total_spent_hours']
+ assert_nil json['issue']['spent_hours']
+ assert_nil json['issue']['total_spent_hours']
end
test "POST /issues.xml should create an issue with the attributes" do