Skip to content

Commit

Permalink
Updated Gemfile.lock and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sej3506 committed Aug 9, 2024
1 parent e15eb2f commit 382462a
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/standardrb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
with:
bundler-cache: true
ruby-version: 3.0.0
- run: bundle exec standardrb --format github --parallel
- run: bundle exec standardrb --format github --parallel
9 changes: 3 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -270,7 +268,6 @@ GEM
zeitwerk (2.6.13)

PLATFORMS
arm64-darwin
x86_64-darwin-21

DEPENDENCIES
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions lib/clearance.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/clearance/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/clearance/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/routing/clearance_routes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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
Expand Down

0 comments on commit 382462a

Please sign in to comment.