Remove triple subject call in `api/v1/lists` spec (#28210)

pull/2532/head
Matt Jankowski 2023-12-04 10:28:19 -05:00 committed by GitHub
parent cca19f5fbb
commit 71e5a16eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 8 deletions

View File

@ -135,8 +135,11 @@ RSpec.describe 'Lists' do
it_behaves_like 'forbidden for wrong scope', 'read read:lists' it_behaves_like 'forbidden for wrong scope', 'read read:lists'
it 'returns the updated list', :aggregate_failures do it 'returns the updated list and updates values', :aggregate_failures do
subject expect { subject }
.to change_list_title
.and change_list_replies_policy
.and change_list_exclusive
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
list.reload list.reload
@ -149,16 +152,16 @@ RSpec.describe 'Lists' do
}) })
end end
it 'updates the list title' do def change_list_title
expect { subject }.to change { list.reload.title }.from('my list').to('list') change { list.reload.title }.from('my list').to('list')
end end
it 'updates the list replies_policy' do def change_list_replies_policy
expect { subject }.to change { list.reload.replies_policy }.from('list').to('followed') change { list.reload.replies_policy }.from('list').to('followed')
end end
it 'updates the list exclusive' do def change_list_exclusive
expect { subject }.to change { list.reload.exclusive }.from(false).to(true) change { list.reload.exclusive }.from(false).to(true)
end end
context 'when the list does not exist' do context 'when the list does not exist' do