Skip to content

Commit

Permalink
Fix rubocop issues
Browse files Browse the repository at this point in the history
  • Loading branch information
texpert committed Aug 12, 2024
1 parent 9a470de commit 795043d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/controllers/camaleon_cms/admin/media_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ def download_private_file

file = cama_uploader.fetch_file("private/#{params[:file]}")

if file.is_a?(Hash) && file[:error].present?
return render plain: helpers.sanitize(file[:error])
end
return render plain: helpers.sanitize(file[:error]) if file.is_a?(Hash) && file[:error].present?

send_file file, disposition: 'inline'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/download_private_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

context 'when the file path is valid and file exists' do
before do
expect_any_instance_of(CamaleonCmsLocalUploader).to receive(:fetch_file).and_return('some_file')
allow_any_instance_of(CamaleonCmsLocalUploader).to receive(:fetch_file).and_return('some_file')

allow_any_instance_of(CamaleonCms::Admin::MediaController).to receive(:send_file)
allow_any_instance_of(CamaleonCms::Admin::MediaController).to receive(:default_render)
Expand Down

0 comments on commit 795043d

Please sign in to comment.