Remove usage of assigns
in controller specs (#30195)
This commit is contained in:
parent
ae363f0555
commit
5b595b8a5a
13 changed files with 66 additions and 51 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue