Skip to content

Commit d21c4b4

Browse files
committed
Rubocop fixes
1 parent aacb1de commit d21c4b4

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

app/controllers/better_together/users/registrations_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ def new
7474
end
7575
end
7676

77-
def create
77+
def create # rubocop:todo Metrics/MethodLength
7878
unless agreements_accepted?
7979
handle_agreements_not_accepted
8080
return
8181
end
8282

8383
# Validate captcha if enabled by host application
84-
unless validate_captcha_if_enabled
84+
unless validate_captcha_if_enabled?
8585
build_resource(sign_up_params)
8686
handle_captcha_validation_failure(resource)
8787
return
@@ -114,7 +114,7 @@ def set_required_agreements
114114
# Hook method for host applications to implement captcha validation
115115
# Override this method in host applications to add Turnstile or other captcha validation
116116
# @return [Boolean] true if captcha is valid or not enabled, false if validation fails
117-
def validate_captcha_if_enabled
117+
def validate_captcha_if_enabled?
118118
# Default implementation - no captcha validation
119119
# Host applications should override this method to implement their captcha logic
120120
true

spec/controllers/better_together/users/registrations_controller_hook_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
require 'rails_helper'
44

5-
RSpec.describe BetterTogether::Users::RegistrationsController, :skip_host_setup,
6-
type: :controller do
5+
RSpec.describe BetterTogether::Users::RegistrationsController, :skip_host_setup do
76
include BetterTogether::CapybaraFeatureHelpers
87

98
routes { BetterTogether::Engine.routes }
@@ -13,11 +12,11 @@
1312
end
1413

1514
describe 'captcha hook methods', :no_auth do
16-
describe '#validate_captcha_if_enabled' do
15+
describe '#validate_captcha_if_enabled?' do
1716
let(:controller_instance) { described_class.new }
1817

1918
it 'returns true by default (no captcha validation)' do
20-
expect(controller_instance.send(:validate_captcha_if_enabled)).to be true
19+
expect(controller_instance.send(:validate_captcha_if_enabled?)).to be true
2120
end
2221
end
2322

0 commit comments

Comments
 (0)