Missing indentation.
This commit is contained in:
parent
947b6fdf46
commit
47c41f474d
|
@ -469,35 +469,34 @@ describe Topic do
|
||||||
let(:topic) { Fabricate(:topic, user: user) }
|
let(:topic) { Fabricate(:topic, user: user) }
|
||||||
let(:another_user) { Fabricate(:user) }
|
let(:another_user) { Fabricate(:user) }
|
||||||
|
|
||||||
context 'rate limits' do
|
context 'rate limits' do
|
||||||
before do
|
before do
|
||||||
SiteSetting.max_topic_invitations_per_day = 2
|
SiteSetting.max_topic_invitations_per_day = 2
|
||||||
RateLimiter.enable
|
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
|
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
|
describe 'when username_or_email is not valid' do
|
||||||
it 'should return the right value' do
|
it 'should return the right value' do
|
||||||
expect do
|
expect do
|
||||||
|
|
Loading…
Reference in New Issue