mirror of https://github.com/mastodon/mastodon
Check response body instead of assigns in account controller concern spec
This commit is contained in:
parent
c47f3415a5
commit
a8886648f3
|
@ -7,7 +7,7 @@ describe AccountControllerConcern do
|
|||
include AccountControllerConcern
|
||||
|
||||
def success
|
||||
head 200
|
||||
render plain: @account.username # rubocop:disable RSpec/InstanceVariable
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -51,12 +51,13 @@ describe AccountControllerConcern do
|
|||
context 'when account is not suspended' do
|
||||
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 }
|
||||
|
||||
expect(assigns(:account)).to eq account
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers['Link'].to_s).to eq(expected_link_headers)
|
||||
expect(response.body)
|
||||
.to include(account.username)
|
||||
end
|
||||
|
||||
def expected_link_headers
|
||||
|
|
Loading…
Reference in New Issue