0
0
Fork 0

Remove usage of assigns in controller specs (#30195)

This commit is contained in:
Matt Jankowski 2024-09-03 11:23:16 -04:00 committed by GitHub
parent ae363f0555
commit 5b595b8a5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 66 additions and 51 deletions

View file

@ -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