From 382462ae89c6062d85f0529857cb8538f5d2b7b5 Mon Sep 17 00:00:00 2001 From: Sara Jackson Date: Fri, 9 Aug 2024 12:00:37 -0400 Subject: [PATCH] Updated Gemfile.lock and linting --- .github/workflows/standardrb.yml | 2 +- Gemfile.lock | 9 +++------ config/routes.rb | 2 +- lib/clearance.rb | 20 ++++++++++---------- lib/clearance/configuration.rb | 2 +- lib/clearance/user.rb | 2 +- spec/configuration_spec.rb | 2 +- spec/routing/clearance_routes_spec.rb | 12 ++++++------ 8 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/standardrb.yml b/.github/workflows/standardrb.yml index fe77d5b4..92ee6b48 100644 --- a/.github/workflows/standardrb.yml +++ b/.github/workflows/standardrb.yml @@ -16,4 +16,4 @@ jobs: with: bundler-cache: true ruby-version: 3.0.0 - - run: bundle exec standardrb --format github --parallel \ No newline at end of file + - run: bundle exec standardrb --format github --parallel diff --git a/Gemfile.lock b/Gemfile.lock index d1f13005..f2ed0d2a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -93,7 +93,7 @@ GEM regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) coderay (1.1.3) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.3) connection_pool (2.4.1) crass (1.0.6) database_cleaner (2.0.2) @@ -120,7 +120,7 @@ GEM factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - ffi (1.17.0) + ffi (1.17.0-x86_64-darwin) ffi-compiler (1.3.2) ffi (>= 1.15.5) rake @@ -147,6 +147,7 @@ GEM method_source (1.1.0) mini_mime (1.1.5) minitest (5.22.3) + mutex_m (0.2.0) net-imap (0.4.14) date net-protocol @@ -156,8 +157,6 @@ GEM timeout net-smtp (0.5.0) net-protocol - nokogiri (1.16.4-arm64-darwin) - racc (~> 1.4) nokogiri (1.16.4-x86_64-darwin) racc (~> 1.4) parallel (1.24.0) @@ -243,7 +242,6 @@ GEM shoulda-matchers (6.2.0) activesupport (>= 5.2.0) smart_properties (1.17.0) - sqlite3 (1.7.3-arm64-darwin) sqlite3 (1.7.3-x86_64-darwin) standard (1.35.1) language_server-protocol (~> 3.17.0.2) @@ -270,7 +268,6 @@ GEM zeitwerk (2.6.13) PLATFORMS - arm64-darwin x86_64-darwin-21 DEPENDENCIES diff --git a/config/routes.rb b/config/routes.rb index 69af6522..ab2d6d75 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -13,7 +13,7 @@ only: Clearance.configuration.user_actions do if Clearance.configuration.allow_password_reset? resource :password, - controller: 'clearance/passwords', + controller: "clearance/passwords", only: [:edit, :update] end end diff --git a/lib/clearance.rb b/lib/clearance.rb index 197b4d37..02841e7c 100644 --- a/lib/clearance.rb +++ b/lib/clearance.rb @@ -1,13 +1,13 @@ -require 'clearance/configuration' -require 'clearance/sign_in_guard' -require 'clearance/session' -require 'clearance/rack_session' -require 'clearance/back_door' -require 'clearance/controller' -require 'clearance/user' -require 'clearance/password_strategies' -require 'clearance/constraints' -require 'clearance/engine' +require "clearance/configuration" +require "clearance/sign_in_guard" +require "clearance/session" +require "clearance/rack_session" +require "clearance/back_door" +require "clearance/controller" +require "clearance/user" +require "clearance/password_strategies" +require "clearance/constraints" +require "clearance/engine" module Clearance end diff --git a/lib/clearance/configuration.rb b/lib/clearance/configuration.rb index ac121ace..755f77af 100644 --- a/lib/clearance/configuration.rb +++ b/lib/clearance/configuration.rb @@ -208,7 +208,7 @@ def allow_sign_up? def allow_password_reset? @allow_password_reset end - + # Specifies which controller actions are allowed for user resources. # This will be `[:create]` is `allow_sign_up` is true (the default), and # empty otherwise. diff --git a/lib/clearance/user.rb b/lib/clearance/user.rb index 0ba9e43c..4debf776 100644 --- a/lib/clearance/user.rb +++ b/lib/clearance/user.rb @@ -150,7 +150,7 @@ module Validations included do validates :email, - email: { mode: :strict }, + email: {mode: :strict}, presence: true, uniqueness: {allow_blank: true, case_sensitive: true}, unless: :email_optional? diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index ee7378db..1421e6db 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -182,7 +182,7 @@ expect(Clearance.configuration.allow_password_reset?).to eq true end end - end + end describe "#user_actions" do context "when allow_sign_up is configured to false" do diff --git a/spec/routing/clearance_routes_spec.rb b/spec/routing/clearance_routes_spec.rb index c18d0391..265c39f7 100644 --- a/spec/routing/clearance_routes_spec.rb +++ b/spec/routing/clearance_routes_spec.rb @@ -63,7 +63,7 @@ end end - context 'password reset disabled' do + context "password reset disabled" do around do |example| Clearance.configure { |config| config.allow_password_reset = false } Rails.application.reload_routes! @@ -72,24 +72,24 @@ Rails.application.reload_routes! end - it 'does not route password edit' do + it "does not route password edit" do user = create(:user) expect(get: "users/#{user.id}/password/edit").not_to be_routable end - it 'does not route to clearance/passwords#update' do + it "does not route to clearance/passwords#update" do user = create(:user) expect(patch: "/users/#{user.id}/password").not_to be_routable end end - context 'reset enabled' do - it 'does route password edit' do + context "reset enabled" do + it "does route password edit" do user = create(:user) expect(get: "users/#{user.id}/password/edit").to be_routable end - it 'does route to clearance/passwords#update' do + it "does route to clearance/passwords#update" do user = create(:user) expect(patch: "/users/#{user.id}/password").to be_routable end