FEATURE: add site setting allow_new_registrations which can be used to block all new account registrations

This commit is contained in:
Neil Lalonde
2014-07-14 15:42:14 -04:00
parent ac3827f700
commit 766196af87
8 changed files with 57 additions and 1 deletions

View File

@@ -148,6 +148,17 @@ describe InvitesController do
end
context 'new registrations are disabled' do
let(:topic) { Fabricate(:topic) }
let(:invite) { topic.invite_by_email(topic.user, "iceking@adventuretime.ooo") }
before { SiteSetting.stubs(:allow_new_registrations).returns(false) }
it "doesn't redeem the invite" do
Invite.any_instance.stubs(:redeem).never
get :show, id: invite.invite_key
end
end
end
context '.create_disposable_invite' do