-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remaining RSpec/LetSetup
cops
#28368
Conversation
@@ -14,7 +14,6 @@ | |||
|
|||
describe 'GET #index' do | |||
let(:scopes) { 'read:filters' } | |||
let!(:filter) { Fabricate(:custom_filter, account: user.account) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We most likely want to still create an object for this test case
@@ -152,7 +152,7 @@ | |||
context 'with follows' do | |||
let(:import_type) { 'following' } | |||
|
|||
let!(:rows) do | |||
before do | |||
[ | |||
{ 'acct' => 'foo@bar' }, | |||
{ 'acct' => 'user@bar', 'show_reblogs' => false, 'notify' => true, 'languages' => %w(fr de) }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line below should be an each
? Same remark throughout that file.
Honestly, I feel like in some cases it splits the test data definitions in ways that make them less readable |
Closing this in favor of submitting smaller PRs -- and I'm also going to do a pass through the whole thing where I add checks that actually do use the currently unused vars, where that makes sense. Will get through that and see what's left. |
The diff lengthy, but fortunately theres only 1-2 changes in most of the files. Changes in a few categories:
let!
that could have been in abefore
or right in the example, so I just moved them in.send
with a symbol so it was seen as not used. This struck me as more confusing than useful in terms of the compactness, so I unrolled the loop into multiple examples.let
and added the usage