From 3d42c55ebed7df82d759cd6937b70d603ca69284 Mon Sep 17 00:00:00 2001 From: Vanessa Burroughs Date: Mon, 11 Nov 2024 16:29:29 -0600 Subject: [PATCH] Fix auto formatting errors --- lib/passageidentity/auth.rb | 2 +- lib/passageidentity/error.rb | 2 +- tests/user_api_test.rb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/passageidentity/auth.rb b/lib/passageidentity/auth.rb index 142f364..eeea9d4 100644 --- a/lib/passageidentity/auth.rb +++ b/lib/passageidentity/auth.rb @@ -72,7 +72,7 @@ def authenticate_request(request) # Get the token based on the strategy - if @auth_strategy.match?(Passage::COOKIE_STRATEGY) + if @auth_strategy == Passage::COOKIE_STRATEGY unless request.cookies.key?('psg_auth_token') raise PassageError.new( message: diff --git a/lib/passageidentity/error.rb b/lib/passageidentity/error.rb index c49c0ee..e13e5a6 100644 --- a/lib/passageidentity/error.rb +++ b/lib/passageidentity/error.rb @@ -7,7 +7,7 @@ module Passage class PassageError < StandardError attr_reader :status_code, :status_text, :message, :error - def initialize(message, status_code: nil, body: nil) + def initialize(message:, status_code: nil, body: nil) super(message) @message = message diff --git a/tests/user_api_test.rb b/tests/user_api_test.rb index d304df5..ce5352c 100644 --- a/tests/user_api_test.rb +++ b/tests/user_api_test.rb @@ -32,7 +32,7 @@ def test_create_delete_user ) assert_equal 'chris+test-create-delete@passage.id', user.email assert_equal 'cool', user.user_metadata[:example1] - PassageClient.user.delete(user_id: user.id) + deleted = PassageClient.user.delete(user_id: user.id) assert_equal true, deleted end @@ -79,7 +79,9 @@ def test_invalid_get_user_by_identifier user = PassageClient.user.get(user_id: $global_test_user.id) assert_equal $global_test_user.id, user.id - assert_raise Passage::PassageError PassageClient.user.get_by_identifier(user_identifier: 'error@passage.id') + assert_raise Passage::PassageError do + PassageClient.user.get_by_identifier(user_identifier: 'error@passage.id') + end end def test_deactivate_user