Skip to content

Commit

Permalink
Fix the remaining specs and rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
kigster committed Apr 15, 2024
1 parent d8dccba commit 2289fa5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 67 deletions.
89 changes: 25 additions & 64 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2024-02-16 22:39:17 UTC using RuboCop version 1.60.2.
# on 2024-04-15 18:59:37 UTC using RuboCop version 1.63.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -23,34 +23,28 @@ Lint/UnmodifiedReduceAccumulator:
Exclude:
- 'app/helpers/shifts_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessAssignment:
Exclude:
- 'config/unicorn.rb'

# Offense count: 19
# Offense count: 26
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 62
Max: 86

# Offense count: 3
# Offense count: 6
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Max: 55
Max: 47

# Offense count: 3
# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 156
Max: 135

# Offense count: 5
# Offense count: 10
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/CyclomaticComplexity:
Max: 13
Max: 14

# Offense count: 24
# Offense count: 36
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 58
Expand All @@ -60,20 +54,19 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Max: 114

# Offense count: 4
# Offense count: 8
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 15
Max: 19

# Offense count: 6
# Offense count: 3
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
Naming/MethodParameterName:
Exclude:
- 'spec/support/factory_bot.rb'
- 'spec/support/time_extensions.rb'

# Offense count: 15
# Offense count: 19
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand All @@ -88,48 +81,30 @@ RSpec/DescribeClass:
Exclude:
- 'spec/lib/fnf/music_submissions_spec.rb'

# Offense count: 1
RSpec/ExpectInHook:
Exclude:
- 'spec/lib/fnf/event_reporter_spec.rb'

# Offense count: 1
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive

# Offense count: 15
# Offense count: 12
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
Max: 11
Max: 12

# Offense count: 3
# Offense count: 2
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Exclude:
- 'spec/controllers/ticket_requests_controller_spec.rb'
- 'spec/lib/fnf/csv_reader_spec.rb'
- 'spec/models/ticket_request_spec.rb'

# Offense count: 60
# Offense count: 69
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 5
Max: 6

# Offense count: 52
# Offense count: 13
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/controllers/emails_controller_spec.rb'
- 'spec/controllers/events_controller_spec.rb'
- 'spec/controllers/ticket_requests_controller_spec.rb'
- 'spec/lib/fnf/event_reporter_spec.rb'
- 'spec/mailers/payment_mailer_spec.rb'
- 'spec/mailers/ticket_request_mailer_spec.rb'
- 'spec/models/event_spec.rb'
- 'spec/models/ticket_request_spec.rb'
- 'spec/models/user_spec.rb'

Expand All @@ -138,14 +113,6 @@ RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/models/event_spec.rb'

# Offense count: 3
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationMailer:
Exclude:
- 'app/mailers/eald_payment_mailer.rb'
- 'app/mailers/payment_mailer.rb'
- 'app/mailers/ticket_request_mailer.rb'

# Offense count: 9
# Configuration parameters: Database, Include.
# SupportedDatabases: mysql, postgresql
Expand Down Expand Up @@ -176,7 +143,7 @@ Rails/HelperInstanceVariable:
Exclude:
- 'app/helpers/shifts_helper.rb'

# Offense count: 14
# Offense count: 15
Rails/I18nLocaleTexts:
Exclude:
- 'app/controllers/home_controller.rb'
Expand Down Expand Up @@ -249,7 +216,7 @@ Rake/Desc:
Exclude:
- 'Rakefile'

# Offense count: 81
# Offense count: 82
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false
Expand All @@ -262,25 +229,19 @@ Style/FrozenStringLiteralComment:
Exclude:
- 'app/models/application_record.rb'

# Offense count: 5
# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/home_controller.rb'
- 'app/controllers/payments_controller.rb'
- 'app/controllers/ticket_requests_controller.rb'
- 'app/models/event.rb'

# Offense count: 1
Style/MissingRespondToMissing:
Exclude:
- 'spec/support/factory_bot.rb'

# Offense count: 7
# Offense count: 8
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 174
Max: 150
2 changes: 1 addition & 1 deletion app/controllers/ticket_requests_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def create
user.save! && sign_in(user)
else
flash.now[:error] = user.errors.full_messages.join('. ')
@ticket_request = TicketRequest.new(tr_params, user: user, event: @event)
@ticket_request = TicketRequest.new(tr_params, user:, event: @event)
return render action: 'new'
end
end
Expand Down
4 changes: 3 additions & 1 deletion config/initializers/active_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ class Time
def xmlschema; end
end

TIME_FORMAT = '%Y/%m/%d %H:%M:%S'
# rubocop: disable Lint/OrAssignmentToConstant
TIME_FORMAT ||= '%Y/%m/%d %H:%M:%S'
# rubocop: enable Lint/OrAssignmentToConstant

DATE_FORMATS.merge!({
friendly: '%A, %B %-d, %Y %l:%M %p %Z',
Expand Down
1 change: 0 additions & 1 deletion spec/controllers/ticket_requests_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@

it { is_expected.to eql(created_user) }
end

end
end
end
Expand Down

0 comments on commit 2289fa5

Please sign in to comment.