Skip to content

Commit

Permalink
allow features and factory specs to not describe their class
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelglass committed Jan 2, 2020
1 parent f507884 commit 0bf65b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
17 changes: 11 additions & 6 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Rails/Exit:
# Include: db/migrate/*.rb
Rails/CreateTableWithTimestamps:
Exclude:
- 'db/migrate/20151210035820_init_schema.rb'
- 'db/migrate/20160211061631_add_chapter_leaderships_again.rb'
- 'db/migrate/20160312224628_create_organization_leaderships.rb'
- db/migrate/20151210035820_init_schema.rb
- db/migrate/20160211061631_add_chapter_leaderships_again.rb
- db/migrate/20160312224628_create_organization_leaderships.rb


# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
Rails/Output:
Exclude:
- 'lib/tasks/**/*' # rake tasks need output
- 'app/jobs/**/*' # heroku scheduler support output# Offense count: 4
- lib/tasks/**/* # rake tasks need output
- app/jobs/**/* # heroku scheduler support output# Offense count: 4

Style/DoubleNegation:
Enabled: false
Expand All @@ -42,4 +42,9 @@ RSpec/AnyInstance:
Enabled: false

RSpec/MessageSpies:
EnforcedStyle: receive
EnforcedStyle: receive

RSpec/DescribeClass:
Exclude:
- spec/features/**/*
- spec/models/factory_spec.rb
4 changes: 0 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ Metrics/PerceivedComplexity:
RSpec/ContextWording:
Enabled: false

# Offense count: 32
RSpec/DescribeClass:
Enabled: false

# Offense count: 166
# Configuration parameters: Max.
RSpec/ExampleLength:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Dir[Rails.root.join('app/mailers/*.rb')].sort.each { |f| require f }
Dir[Rails.root.join('spec/mailers/previews/**/*.rb')].sort.each { |f| require f }

RSpec.describe 'mailer previews' do
RSpec.describe Devise::MailerPreview do
def find_preview_class(mailer_class)
mailer_name = mailer_class.to_s.sub('Mailer', '')
"#{mailer_name}Preview".constantize
Expand All @@ -33,8 +33,8 @@ def find_leaves(klass)
expect(Devise::Mailer).to receive(mailer_method)
end

Devise::MailerPreview.instance_methods(false).each do |preview_method|
Devise::MailerPreview.new.send(preview_method)
described_class.instance_methods(false).each do |preview_method|
described_class.new.send(preview_method)
end
end

Expand Down

0 comments on commit 0bf65b5

Please sign in to comment.