FIX: always allow tl1 through for typing speed tests

This commit is contained in:
Sam
2015-08-06 10:07:18 +10:00
parent dbd6099b89
commit 11d39345b3
2 changed files with 34 additions and 6 deletions
+26
View File
@@ -192,4 +192,30 @@ describe NewPostManager do
end
context "user needs approval?" do
let :user do
user = Fabricate.build(:user, trust_level: 0)
user_stat = UserStat.new(post_count: 0)
user.user_stat = user_stat
user
end
it "handles user_needs_approval? correctly" do
u = user
default = NewPostManager.new(u,{})
expect(NewPostManager.user_needs_approval?(default)).to eq(false)
with_check = NewPostManager.new(u,{first_post_checks: true})
expect(NewPostManager.user_needs_approval?(with_check)).to eq(true)
u.trust_level = 1
with_check_tl1 = NewPostManager.new(u,{first_post_checks: true})
expect(NewPostManager.user_needs_approval?(with_check_tl1)).to eq(false)
end
end
end