From 53278e3744529ca64b4cc56b60e71d72fde82d50 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 26 Aug 2016 14:46:14 +0200 Subject: [PATCH] Fixed tests. --- test/controllers/settings_controller_test.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/controllers/settings_controller_test.rb b/test/controllers/settings_controller_test.rb index d729c13e2..8976694ad 100644 --- a/test/controllers/settings_controller_test.rb +++ b/test/controllers/settings_controller_test.rb @@ -83,10 +83,10 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest # show setting = Setting.find_by(name: 'product_name') - get "/api/v1/settings/#{setting.id}", {} + get "/api/v1/settings/#{setting.id}", {}, @headers assert_response(401) result = JSON.parse(@response.body) - assert_equal('Not authorized', result['error']) + assert_equal('authentication failed', result['error']) end test 'settings index with admin' do @@ -269,7 +269,7 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest get "/api/v1/settings/#{setting.id}", {}, @headers.merge('Authorization' => credentials) assert_response(401) result = JSON.parse(@response.body) - assert_equal('Not authorized (user)', result['error']) + assert_equal('Not authorized (user)!', result['error']) end test 'settings index with customer' do @@ -289,14 +289,14 @@ class SettingsControllerTest < ActionDispatch::IntegrationTest get "/api/v1/settings/#{setting.id}", {}, @headers.merge('Authorization' => credentials) assert_response(401) result = JSON.parse(@response.body) - assert_equal('Not authorized (user)', result['error']) + assert_equal('Not authorized (user)!', result['error']) # delete setting = Setting.find_by(name: 'product_name') delete "/api/v1/settings/#{setting.id}", {}.to_json, @headers.merge('Authorization' => credentials) assert_response(401) result = JSON.parse(@response.body) - assert_equal('Not authorized (feature not possible)', result['error']) + assert_equal('Not authorized (user)!', result['error']) end end