Missing indentation.

This commit is contained in:
Guo Xiang Tan 2018-03-01 13:12:13 +08:00
parent 947b6fdf46
commit 47c41f474d
1 changed files with 26 additions and 27 deletions

View File

@ -469,35 +469,34 @@ describe Topic do
let(:topic) { Fabricate(:topic, user: user) }
let(:another_user) { Fabricate(:user) }
context 'rate limits' do
before do
SiteSetting.max_topic_invitations_per_day = 2
RateLimiter.enable
context 'rate limits' do
before do
SiteSetting.max_topic_invitations_per_day = 2
RateLimiter.enable
end
after do
RateLimiter.clear_all!
RateLimiter.disable
end
it "rate limits topic invitations" do
start = Time.now.tomorrow.beginning_of_day
freeze_time(start)
trust_level_2 = Fabricate(:user, trust_level: 2)
topic = Fabricate(:topic, user: trust_level_2)
topic.invite(topic.user, user.username)
topic.invite(topic.user, "walter@white.com")
expect {
topic.invite(topic.user, "user@example.com")
}.to raise_error(RateLimiter::LimitExceeded)
end
end
after do
RateLimiter.clear_all!
RateLimiter.disable
end
it "rate limits topic invitations" do
start = Time.now.tomorrow.beginning_of_day
freeze_time(start)
user = Fabricate(:user)
trust_level_2 = Fabricate(:user, trust_level: 2)
topic = Fabricate(:topic, user: trust_level_2)
topic.invite(topic.user, user.username)
topic.invite(topic.user, "walter@white.com")
expect {
topic.invite(topic.user, "user@example.com")
}.to raise_error(RateLimiter::LimitExceeded)
end
end
describe 'when username_or_email is not valid' do
it 'should return the right value' do
expect do