TMA-732: fix edge cases for user input sanitized MUFs#1092
Conversation
| end | ||
|
|
||
| context 'when using sync_multiple_projects_based_on_custom_id mode' do | ||
| let(:params) do |
There was a problem hiding this comment.
Similar code found in synchronize_user_filters_spec.rb:79, synchronize_user_filters_spec.rb:148 (mass = 52)
| end | ||
| let(:CSV) { double('CSV') } | ||
|
|
||
| before do |
There was a problem hiding this comment.
Identical code found in synchronize_user_filters_spec.rb:93, synchronize_user_filters_spec.rb:162 (mass = 152)
| CSV.foreach(File.open(data_source.realize(params), 'r:UTF-8'), headers: csv_with_headers, return_headers: false, encoding: 'utf-8') do |row| | ||
| filters << row.to_hash | ||
| end | ||
| fail 'The filter set can not be empty when using sync_multiple_projects_based_on_custom_id mode' if filters.empty? |
There was a problem hiding this comment.
Calls 'filters.empty?' 2 times (DuplicateMethodCall)
| it 'fails if the MUF set is empty' do | ||
| expect(File).to receive(:open) | ||
| expect(CSV).to receive(:foreach) | ||
| expect { subject.class.call(params) }.to raise_error /The filter set can not be empty/ |
There was a problem hiding this comment.
Lint/AmbiguousRegexpLiteral: Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division.
|
Build failed (check pipeline).
|
|
|
||
| context 'when using sync_multiple_projects_based_on_custom_id mode' do | ||
| include_context 'using mode with custom_id' | ||
| let(:params) do |
There was a problem hiding this comment.
Similar code found in synchronize_user_filters_spec.rb:94, synchronize_user_filters_spec.rb:153 (mass = 52)
|
Build failed (check pipeline).
|
|
Build succeeded (check pipeline).
|
|
ok to merge |
| def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users) | ||
| return to_delete unless users_brick_input && users_brick_input.any? | ||
| user_profiles = users_brick_input.map do |user| | ||
| result = project_users.find { |u| u.login == user['login'] } |
There was a problem hiding this comment.
Calls 'filter[:label]' 4 times (DuplicateMethodCall)
| def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users) | ||
| return to_delete unless users_brick_input && users_brick_input.any? | ||
| user_profiles = users_brick_input.map do |user| | ||
| result = project_users.find { |u| u.login == user['login'] } |
There was a problem hiding this comment.
Contains iterators nested 3 deep (NestedIterators)
| def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users) | ||
| return to_delete unless users_brick_input && users_brick_input.any? | ||
| user_profiles = users_brick_input.map do |user| | ||
| result = project_users.find { |u| u.login == user['login'] } |
There was a problem hiding this comment.
Has the variable name 'l' (UncommunicativeVariableName)
|
Build failed (gate pipeline).
|
|
Build succeeded (gate pipeline).
|
No description provided.