2020-11-24 15:15:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
require 'rubocop_spec_helper'
|
2020-11-24 15:15:51 +05:30
|
|
|
require_relative '../../../../rubocop/cop/gitlab/avoid_uploaded_file_from_params'
|
|
|
|
|
2021-03-08 18:12:59 +05:30
|
|
|
RSpec.describe RuboCop::Cop::Gitlab::AvoidUploadedFileFromParams do
|
2021-03-11 19:13:27 +05:30
|
|
|
context 'when using UploadedFile.from_params' do
|
2020-11-24 15:15:51 +05:30
|
|
|
it 'flags its call' do
|
|
|
|
expect_offense(<<~SOURCE)
|
2021-03-11 19:13:27 +05:30
|
|
|
UploadedFile.from_params(params)
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use the `UploadedFile` set by `multipart.rb` instead of calling [...]
|
2020-11-24 15:15:51 +05:30
|
|
|
SOURCE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|