diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-10-22 17:37:16 +0000 |
commit | 2d1866d966d94c688f9cb87c5bf3f096dffac844 (patch) | |
tree | 7a733c1cc51448ab69b3f892285305dbfb0ae15e /test/integration/api_test | |
parent | a6ec78a4dc658e3517ed682792016b6530458696 (diff) | |
download | redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.tar.gz redmine-2d1866d966d94c688f9cb87c5bf3f096dffac844.zip |
Merged rails-4.1 branch (#14534).
git-svn-id: http://svn.redmine.org/redmine/trunk@13482 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test')
-rw-r--r-- | test/integration/api_test/authentication_test.rb | 7 | ||||
-rw-r--r-- | test/integration/api_test/memberships_test.rb | 2 | ||||
-rw-r--r-- | test/integration/api_test/projects_test.rb | 12 |
3 files changed, 9 insertions, 12 deletions
diff --git a/test/integration/api_test/authentication_test.rb b/test/integration/api_test/authentication_test.rb index 16c589d3e..b8c9e0746 100644 --- a/test/integration/api_test/authentication_test.rb +++ b/test/integration/api_test/authentication_test.rb @@ -41,11 +41,8 @@ class Redmine::ApiTest::AuthenticationTest < Redmine::ApiTest::Base end def test_invalid_utf8_credentials_should_not_trigger_an_error - invalid_utf8 = "\x82" - if invalid_utf8.respond_to?(:force_encoding) - invalid_utf8.force_encoding('UTF-8') - assert !invalid_utf8.valid_encoding? - end + invalid_utf8 = "\x82".force_encoding('UTF-8') + assert !invalid_utf8.valid_encoding? assert_nothing_raised do get '/users/current.xml', {}, credentials(invalid_utf8, "foo") end diff --git a/test/integration/api_test/memberships_test.rb b/test/integration/api_test/memberships_test.rb index 7ad0c5790..2493c797d 100644 --- a/test/integration/api_test/memberships_test.rb +++ b/test/integration/api_test/memberships_test.rb @@ -165,7 +165,7 @@ class Redmine::ApiTest::MembershipsTest < Redmine::ApiTest::Base assert_response :unprocessable_entity assert_equal 'application/xml', @response.content_type - assert_tag 'errors', :child => {:tag => 'error', :content => /member_roles is invalid/} + assert_tag 'errors', :child => {:tag => 'error', :content => /role can't be empty/i} end test "DELETE /memberships/:id.xml should destroy the membership" do diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb index 28b8b9452..a345f5822 100644 --- a/test/integration/api_test/projects_test.rb +++ b/test/integration/api_test/projects_test.rb @@ -195,12 +195,12 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base end test "POST /projects.xml with valid parameters should create the project" do - Setting.default_projects_modules = ['issue_tracking', 'repository'] - - assert_difference('Project.count') do - post '/projects.xml', - {:project => {:name => 'API test', :identifier => 'api-test'}}, - credentials('admin') + with_settings :default_projects_modules => ['issue_tracking', 'repository'] do + assert_difference('Project.count') do + post '/projects.xml', + {:project => {:name => 'API test', :identifier => 'api-test'}}, + credentials('admin') + end end project = Project.order('id DESC').first |