mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-22 23:03:23 +00:00
Add specs for Admin::InvitesController (#9471)
This commit is contained in:
parent
81bda7d67c
commit
ae3d2f446a
|
@ -1,3 +1,5 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Admin::InvitesController do
|
describe Admin::InvitesController do
|
||||||
|
@ -40,4 +42,18 @@ describe Admin::InvitesController do
|
||||||
expect(invite.reload).to be_expired
|
expect(invite.reload).to be_expired
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'POST #deactivate_all' do
|
||||||
|
it 'expires all invites, then redirects to admin_invites_path' do
|
||||||
|
invites = Fabricate.times(2, :invite, expires_at: nil)
|
||||||
|
|
||||||
|
post :deactivate_all
|
||||||
|
|
||||||
|
invites.each do |invite|
|
||||||
|
expect(invite.reload).to be_expired
|
||||||
|
end
|
||||||
|
|
||||||
|
expect(response).to redirect_to admin_invites_path
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue