Apply Rails/DynamicFindBy rubocop rule
We were already using `find_by` most of the time. Since there are false positives related to our `find_by_slug_or_id!` and `find_by_manger_login` methods, which cannot be replaced with `find_by`, I'm adding it indicating the "refactor" severity.
This commit is contained in:
@@ -25,7 +25,7 @@ describe "Admin custom pages" do
|
||||
|
||||
expect(SiteCustomization::Page.count).to be 7
|
||||
slugs.each do |slug|
|
||||
expect(SiteCustomization::Page.find_by_slug(slug).status).to eq "published"
|
||||
expect(SiteCustomization::Page.find_by(slug: slug).status).to eq "published"
|
||||
end
|
||||
|
||||
expect(all("[id^='site_customization_page_']").count).to be 7
|
||||
|
||||
Reference in New Issue
Block a user