Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kmycode committed Feb 24, 2025
1 parent a72160b commit 97a86bc
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions spec/controllers/admin/export_domain_blocks_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def domain_blocks_csv_file
end

it 'renders page with extended domain blocks' do
expect(assigns(:domain_blocks).map { |block| [block.domain, block.reject_favourite, block.reject_friend] }).to contain_exactly(
['bad.domain', false, false],
['worse.domain', false, false],
['reject.media', false, false],
['little.spam', true, false]
expect(mapped_batch_table_rows_with_expanded_params).to contain_exactly(
['bad.domain', false],
['worse.domain', false],
['reject.media', false],
['little.spam', true]
)
end

Expand All @@ -73,6 +73,10 @@ def mapped_batch_table_rows
batch_table_rows.map { |row| [row.at_css('[id$=_domain]')['value'], row.at_css('[id$=_severity]')['value'].to_sym] }
end

def mapped_batch_table_rows_with_expanded_params
batch_table_rows.map { |row| [row.at_css('[id$=_domain]')['value'], row.at_css('[id$=_reject_favourite]')['value'] == 'true'] }
end

def batch_table_rows
response.parsed_body.css('body div.batch-table__row')
end
Expand Down

0 comments on commit 97a86bc

Please sign in to comment.