Add and apply ConstantDefinitionInBlock rule
This rule was added in Rubocop 0.91.0. A similar rule named LeakyConstantDeclaration was added in rubocop-rspec 1.34.0. Note using the FILENAMES constant did not result in an offense using the ConstantDefinitionInBlock rule but did result in an offense using the LeakyConstantDeclaration rule. I've simplified the code to get rid of the constant; not sure why we were adding a constant with `||=` in the middle of a spec.
This commit is contained in:
@@ -235,12 +235,11 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na
|
||||
end
|
||||
login_as user_to_login
|
||||
visit send(path, arguments)
|
||||
FILENAMES ||= %w[clippy empty logo].freeze
|
||||
|
||||
send(fill_resource_method_name) if fill_resource_method_name
|
||||
|
||||
documentable.class.max_documents_allowed.times.zip(FILENAMES).each do |_n, fn|
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/#{fn}.pdf"))
|
||||
%w[clippy empty logo].take(documentable.class.max_documents_allowed).each do |filename|
|
||||
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/#{filename}.pdf"))
|
||||
end
|
||||
|
||||
click_on submit_button
|
||||
|
||||
Reference in New Issue
Block a user