diff --git a/spec/requests/api/v1/authentication_controller_spec.rb b/spec/requests/api/v1/authentication_controller_spec.rb index e19fe6ab24..4f1b7b0a98 100644 --- a/spec/requests/api/v1/authentication_controller_spec.rb +++ b/spec/requests/api/v1/authentication_controller_spec.rb @@ -20,14 +20,14 @@ it 'calls the Api::Jwt::AuthenticationService' do Api::V1::Auth::Jwt::AuthenticationService.any_instance.expects(:call).at_most(1) - post api_v1_authenticate_path, params: @payload.to_json + post api_v1_authenticate_path, params: @payload, as: :json end it 'renders /api/v1/error template if authentication fails' do errs = [Faker::Lorem.sentence] Api::V1::Auth::Jwt::AuthenticationService.any_instance .stubs(:call).returns(nil) .stubs(:errors).returns(errs) - post api_v1_authenticate_path, params: @payload.to_json + post api_v1_authenticate_path, params: @payload, as: :json expect(response.code).to eql('401') expect(response).to render_template('api/v1/error') end @@ -35,7 +35,7 @@ token = Api::V1::Auth::Jwt::JsonWebToken.encode(payload: @payload) Api::V1::Auth::Jwt::AuthenticationService.any_instance.stubs(:call) .returns(token) - post api_v1_authenticate_path, params: @payload.to_json + post api_v1_authenticate_path, params: @payload, as: :json expect(response.code).to eql('200') expect(response).to render_template('api/v1/token') end