mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Check response body instead of assigns in account controller concern spec
This commit is contained in:
parent
60b47f8512
commit
4e9bd7d811
1 changed files with 4 additions and 3 deletions
|
@ -7,7 +7,7 @@ describe AccountControllerConcern do
|
||||||
include AccountControllerConcern
|
include AccountControllerConcern
|
||||||
|
|
||||||
def success
|
def success
|
||||||
head 200
|
render plain: @account.username # rubocop:disable RSpec/InstanceVariable
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -51,12 +51,13 @@ describe AccountControllerConcern do
|
||||||
context 'when account is not suspended' do
|
context 'when account is not suspended' do
|
||||||
let(:account) { Fabricate(:account, username: 'username') }
|
let(:account) { Fabricate(:account, username: 'username') }
|
||||||
|
|
||||||
it 'assigns @account, returns success, and sets link headers' do
|
it 'Prepares the account, returns success, and sets link headers' do
|
||||||
get 'success', params: { account_username: account.username }
|
get 'success', params: { account_username: account.username }
|
||||||
|
|
||||||
expect(assigns(:account)).to eq account
|
|
||||||
expect(response).to have_http_status(200)
|
expect(response).to have_http_status(200)
|
||||||
expect(response.headers['Link'].to_s).to eq(expected_link_headers)
|
expect(response.headers['Link'].to_s).to eq(expected_link_headers)
|
||||||
|
expect(response.body)
|
||||||
|
.to include(account.username)
|
||||||
end
|
end
|
||||||
|
|
||||||
def expected_link_headers
|
def expected_link_headers
|
||||||
|
|
Loading…
Reference in a new issue