Rubocop fixes (#5244)

This commit is contained in:
Anna Buianova 2019-12-26 19:52:36 +03:00 committed by Ben Halpern
parent d091b4c4fd
commit 31d51999df
2 changed files with 5 additions and 7 deletions

View file

@ -235,13 +235,11 @@ RSpec.describe Article, type: :model do
# this works because validation triggers the extraction of the date from the front matter
published_article = create(:article, published: true, user: user)
expect(published_article.reload.nth_published_by_author).to eq(user.articles.size)
second_article = create(:article, user_id: published_article.user_id)
create(:article, user_id: published_article.user_id)
published_article.update_column(:nth_published_by_author, 0)
published_article.save
expect(published_article.reload.nth_published_by_author).to eq(user.articles.size - 1)
end
end
describe "#crossposted_at" do

View file

@ -28,10 +28,10 @@ require "test_prof/recipes/rspec/sample"
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/system/shared_examples/**/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/models/shared_examples/**/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/jobs/shared_examples/**/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/support/**/*.rb")].sort.each { |f| require f }
Dir[Rails.root.join("spec/system/shared_examples/**/*.rb")].sort.each { |f| require f }
Dir[Rails.root.join("spec/models/shared_examples/**/*.rb")].sort.each { |f| require f }
Dir[Rails.root.join("spec/jobs/shared_examples/**/*.rb")].sort.each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.