mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-22 16:28:08 +01:00
Add change assertion to invites destroy spec (#31004)
This commit is contained in:
parent
bb702e6b20
commit
73d53827ea
1 changed files with 8 additions and 11 deletions
|
@ -69,19 +69,16 @@ describe InvitesController do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'DELETE #create' do
|
||||
describe 'DELETE #destroy' do
|
||||
subject { delete :destroy, params: { id: invite.id } }
|
||||
|
||||
let(:invite) { Fabricate(:invite, user: user, expires_at: nil) }
|
||||
|
||||
before do
|
||||
delete :destroy, params: { id: invite.id }
|
||||
end
|
||||
|
||||
it 'redirects' do
|
||||
expect(response).to redirect_to invites_path
|
||||
end
|
||||
|
||||
it 'expires invite' do
|
||||
expect(invite.reload).to be_expired
|
||||
it 'expires invite and redirects' do
|
||||
expect { subject }
|
||||
.to(change { invite.reload.expired? }.to(true))
|
||||
expect(response)
|
||||
.to redirect_to invites_path
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue