Speed-up in Settings::
controllers specs (#27808)
This commit is contained in:
parent
ac62b995ef
commit
9dc3ce878b
14 changed files with 65 additions and 216 deletions
|
@ -14,22 +14,16 @@ describe Settings::DeletesController do
|
|||
get :show
|
||||
end
|
||||
|
||||
it 'renders confirmation page' do
|
||||
it 'renders confirmation page with private cache control headers', :aggregate_failures do
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
|
||||
it 'returns private cache control headers' do
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
end
|
||||
|
||||
context 'when suspended' do
|
||||
let(:user) { Fabricate(:user, account_attributes: { suspended_at: Time.now.utc }) }
|
||||
|
||||
it 'returns http forbidden' do
|
||||
it 'returns http forbidden with private cache control headers', :aggregate_failures do
|
||||
expect(response).to have_http_status(403)
|
||||
end
|
||||
|
||||
it 'returns private cache control headers' do
|
||||
expect(response.headers['Cache-Control']).to include('private, no-store')
|
||||
end
|
||||
end
|
||||
|
@ -56,19 +50,10 @@ describe Settings::DeletesController do
|
|||
delete :destroy, params: { form_delete_confirmation: { password: 'petsmoldoggos' } }
|
||||
end
|
||||
|
||||
it 'redirects to sign in page' do
|
||||
it 'removes user record and redirects', :aggregate_failures do
|
||||
expect(response).to redirect_to '/auth/sign_in'
|
||||
end
|
||||
|
||||
it 'removes user record' do
|
||||
expect(User.find_by(id: user.id)).to be_nil
|
||||
end
|
||||
|
||||
it 'marks account as suspended' do
|
||||
expect(user.account.reload).to be_suspended
|
||||
end
|
||||
|
||||
it 'does not create an email block' do
|
||||
expect(CanonicalEmailBlock.block?(user.email)).to be false
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue