mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Check response body instead of assigns in settings imports controller spec
This commit is contained in:
parent
151f1e6d9d
commit
f7574c42db
2 changed files with 6 additions and 4 deletions
|
@ -46,7 +46,7 @@
|
|||
%th= t('imports.failures')
|
||||
%tbody
|
||||
- @recent_imports.each do |import|
|
||||
%tr
|
||||
%tr{ id: dom_id(import) }
|
||||
%td= t("imports.types.#{import.type}")
|
||||
%td
|
||||
- if import.state_unconfirmed?
|
||||
|
|
|
@ -21,9 +21,10 @@ RSpec.describe Settings::ImportsController do
|
|||
|
||||
it 'assigns the expected imports', :aggregate_failures do
|
||||
expect(response).to have_http_status(200)
|
||||
expect(assigns(:recent_imports)).to eq [import]
|
||||
expect(assigns(:recent_imports)).to_not include(other_import)
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
expect(response.body)
|
||||
.to include("bulk_import_#{import.id}")
|
||||
.and not_include("bulk_import_#{other_import.id}")
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -261,7 +262,8 @@ RSpec.describe Settings::ImportsController do
|
|||
it 'does not creates an unconfirmed bulk_import', :aggregate_failures do
|
||||
expect { subject }.to_not(change { user.account.bulk_imports.count })
|
||||
|
||||
expect(assigns(:import).errors).to_not be_empty
|
||||
expect(response.body)
|
||||
.to include('field_with_errors')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue