Remove final remaining assigns
usage in controller specs (#33866)
This commit is contained in:
parent
1cf30717db
commit
8c240ef042
3 changed files with 26 additions and 21 deletions
|
@ -59,16 +59,15 @@ RSpec.describe Admin::AccountsController do
|
|||
let(:account) { Fabricate(:account) }
|
||||
|
||||
it 'includes moderation notes' do
|
||||
note1 = Fabricate(:account_moderation_note, target_account: account)
|
||||
note2 = Fabricate(:account_moderation_note, target_account: account)
|
||||
note1 = Fabricate(:account_moderation_note, target_account: account, content: 'Note 1 remarks')
|
||||
note2 = Fabricate(:account_moderation_note, target_account: account, content: 'Note 2 remarks')
|
||||
|
||||
get :show, params: { id: account.id }
|
||||
expect(response).to have_http_status(200)
|
||||
|
||||
moderation_notes = assigns(:moderation_notes).to_a
|
||||
|
||||
expect(moderation_notes.size).to be 2
|
||||
expect(moderation_notes).to eq [note1, note2]
|
||||
expect(response.body)
|
||||
.to include(note1.content)
|
||||
.and include(note2.content)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue