Remove triple subject call in `api/v1/lists` spec (#28210)
This commit is contained in:
parent
cca19f5fbb
commit
71e5a16eba
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue