Skip to content

Commit

Permalink
Merge pull request #52 from MatthewKennedy/lint-rubocop
Browse files Browse the repository at this point in the history
Basic Rubocop Lint fixes
  • Loading branch information
tcannonfodder authored Dec 5, 2023
2 parents 6940cc5 + 28b7446 commit 2985ac0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ group :development, :test do
gem "debug"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.21"
gem 'yard'
gem 'webrick'
gem "webrick"
gem "yard"
end

group :test do
Expand Down
4 changes: 3 additions & 1 deletion gemfiles/rails_6.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
Expand All @@ -10,8 +12,8 @@ group :development, :test do
gem "debug"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.21"
gem "yard"
gem "webrick"
gem "yard"
end

group :test do
Expand Down
4 changes: 3 additions & 1 deletion gemfiles/rails_7.gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# This file was generated by Appraisal

source "https://rubygems.org"
Expand All @@ -10,8 +12,8 @@ group :development, :test do
gem "debug"
gem "rake", "~> 13.0"
gem "rubocop", "~> 1.21"
gem "yard"
gem "webrick"
gem "yard"
end

group :test do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ def user_details_for_registration
end

def verify_credential_integrity
return render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil?
render_credential_missing_or_could_not_be_parsed_error if parsed_credential.nil?
rescue JSON::JSONError, TypeError
return render_credential_missing_or_could_not_be_parsed_error
render_credential_missing_or_could_not_be_parsed_error
end

def verify_passkey_challenge
Expand Down Expand Up @@ -137,7 +137,8 @@ def reauthentication_params
def render_credential_missing_or_could_not_be_parsed_error
render json: { message: find_message(:credential_missing_or_could_not_be_parsed) }, status: :bad_request
delete_registration_challenge
return false

false
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def prepare_params
end

# @!visibility public
# A method that can be overridden to customize the Warden stratey used.
# A method that can be overridden to customize the Warden strategy used.
# @return [Symbol] The key that identifies which `Warden` strategy will be used to handle the
# authentication flow for the reauthentication. Defaults to `:passkey_reauthentication`
def strategy
Expand Down
4 changes: 3 additions & 1 deletion test/test_helper/extra_assertions.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module ExtraAssertions
def assert_translation_missing_message(translation_key:)
assert_translation_missing(translation_key: translation_key, field: "message")
Expand All @@ -9,7 +11,7 @@ def assert_translation_missing_error(translation_key:)

def assert_translation_missing(translation_key:, field:)
assert_equal [field], response.parsed_body.keys
assert_match /^translation missing/i, response.parsed_body[field]
assert_match(/^translation missing/i, response.parsed_body[field])
assert_equal true, response.parsed_body[field].include?(translation_key)
end
end

0 comments on commit 2985ac0

Please sign in to comment.