summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/api_test')
-rw-r--r--test/integration/api_test/authentication_test.rb8
-rw-r--r--test/integration/api_test/news_test.rb2
2 files changed, 7 insertions, 3 deletions
diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb
index 23641b53a..4145fb969 100644
--- a/test/integration/api_test/authentication_test.rb
+++ b/test/integration/api_test/authentication_test.rb
@@ -127,20 +127,23 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base
assert_response :unauthorized
end
+ # TODO: check why this test does not use the API endpoint
def test_api_should_accept_switch_user_header_for_admin_user
user = User.find(1)
su = User.find(4)
get '/users/current', :headers => {'X-Redmine-API-Key' => user.api_key, 'X-Redmine-Switch-User' => su.login}
assert_response :success
- assert_select 'h2', :text => su.name
+ assert_select 'h2', :text => "#{su.initials} #{su.name}"
end
+ # TODO: check why this test does not use the API endpoint
def test_api_should_respond_with_412_when_trying_to_switch_to_a_invalid_user
get '/users/current', :headers => {'X-Redmine-API-Key' => User.find(1).api_key, 'X-Redmine-Switch-User' => 'foobar'}
assert_response :precondition_failed
end
+ # TODO: check why this test does not use the API endpoint
def test_api_should_respond_with_412_when_trying_to_switch_to_a_locked_user
user = User.find(5)
assert user.locked?
@@ -149,12 +152,13 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base
assert_response :precondition_failed
end
+ # TODO: check why this test does not use the API endpoint
def test_api_should_not_accept_switch_user_header_for_non_admin_user
user = User.find(2)
su = User.find(4)
get '/users/current', :headers => {'X-Redmine-API-Key' => user.api_key, 'X-Redmine-Switch-User' => su.login}
assert_response :success
- assert_select 'h2', :text => user.name
+ assert_select 'h2', :text => "#{user.initials} #{user.name}"
end
end
diff --git a/test/integration/api_test/news_test.rb b/test/integration/api_test/news_test.rb
index bd9f2bb6d..399b2b347 100644
--- a/test/integration/api_test/news_test.rb
+++ b/test/integration/api_test/news_test.rb
@@ -62,7 +62,7 @@ class Redmine::ApiTest::NewsTest < Redmine::ApiTest::Base
assert_select "author[id=2][name=\"John Smith\"]"
assert_select 'title', 'eCookbook first release !'
assert_select 'summary', 'First version was released...'
- assert_select 'description', "eCookbook 1.0 has been released.\n\nVisit http://ecookbook.somenet.foo/"
+ assert_select 'description', 'eCookbook 1.0 has been released. Visit http://ecookbook.somenet.foo/'
assert_select 'created_on', News.find(1).created_on.iso8601
end
end