remove elder terminology in specs
This commit is contained in:
parent
8b634b5f0f
commit
e3f7d2a3ac
|
@ -7,8 +7,8 @@ describe Guardian do
|
|||
let(:user) { build(:user) }
|
||||
let(:moderator) { build(:moderator) }
|
||||
let(:admin) { build(:admin) }
|
||||
let(:leader) { build(:user, trust_level: 3) }
|
||||
let(:elder) { build(:user, trust_level: 4) }
|
||||
let(:trust_level_3) { build(:user, trust_level: 3) }
|
||||
let(:trust_level_4) { build(:user, trust_level: 4) }
|
||||
let(:another_admin) { build(:admin) }
|
||||
let(:coding_horror) { build(:coding_horror) }
|
||||
|
||||
|
@ -426,11 +426,11 @@ describe Guardian do
|
|||
end
|
||||
|
||||
it 'is true for trust level 4' do
|
||||
Guardian.new(Fabricate(:elder)).can_see?(post_revision).should == true
|
||||
Guardian.new(trust_level_4).can_see?(post_revision).should == true
|
||||
end
|
||||
|
||||
it 'is false for trust level lower than 4' do
|
||||
Guardian.new(Fabricate(:leader)).can_see?(post_revision).should == false
|
||||
Guardian.new(trust_level_3).can_see?(post_revision).should == false
|
||||
end
|
||||
|
||||
it 'is true if the author has public edit history' do
|
||||
|
@ -535,8 +535,8 @@ describe Guardian do
|
|||
Guardian.new(admin).can_create?(Post, topic).should be_true
|
||||
end
|
||||
|
||||
it "allows new posts from elders" do
|
||||
Guardian.new(elder).can_create?(Post, topic).should be_true
|
||||
it "allows new posts from trust_level_4s" do
|
||||
Guardian.new(trust_level_4).can_create?(Post, topic).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -756,7 +756,7 @@ describe Guardian do
|
|||
end
|
||||
|
||||
it 'returns true as a trust level 4 user' do
|
||||
Guardian.new(elder).can_edit?(post).should be_true
|
||||
Guardian.new(trust_level_4).can_edit?(post).should be_true
|
||||
end
|
||||
|
||||
context 'post is older than post_edit_time_limit' do
|
||||
|
@ -849,7 +849,7 @@ describe Guardian do
|
|||
end
|
||||
|
||||
it 'returns true at trust level 3' do
|
||||
Guardian.new(leader).can_edit?(topic).should eq(true)
|
||||
Guardian.new(trust_level_3).can_edit?(topic).should eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -863,7 +863,7 @@ describe Guardian do
|
|||
end
|
||||
|
||||
it 'returns true at trust level 3' do
|
||||
Guardian.new(leader).can_edit?(build(:topic, user: user, archived: true)).should == true
|
||||
Guardian.new(trust_level_3).can_edit?(build(:topic, user: user, archived: true)).should == true
|
||||
end
|
||||
|
||||
it 'returns false as a topic creator' do
|
||||
|
@ -943,7 +943,7 @@ describe Guardian do
|
|||
end
|
||||
|
||||
it 'returns true when trust level 4' do
|
||||
Guardian.new(elder).can_moderate?(topic).should be_true
|
||||
Guardian.new(trust_level_4).can_moderate?(topic).should be_true
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -1840,8 +1840,8 @@ describe Guardian do
|
|||
Guardian.new(admin).can_wiki?.should be_true
|
||||
end
|
||||
|
||||
it 'returns true for elder user' do
|
||||
Guardian.new(elder).can_wiki?.should be_true
|
||||
it 'returns true for trust_level_4 user' do
|
||||
Guardian.new(trust_level_4).can_wiki?.should be_true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ describe InvitesController do
|
|||
end
|
||||
|
||||
it "fails for normal user if invite email already exists" do
|
||||
user = log_in(:elder)
|
||||
user = log_in(:trust_level_4)
|
||||
invite = Invite.invite_by_email("invite@example.com", user)
|
||||
invite.reload
|
||||
post :create, email: invite.email
|
||||
|
|
|
@ -537,7 +537,7 @@ describe PostsController do
|
|||
end
|
||||
|
||||
it "ensures trust level 4 can see the revisions" do
|
||||
log_in(:elder)
|
||||
log_in(:trust_level_4)
|
||||
xhr :get, :revisions, post_id: post_revision.post_id, revision: post_revision.number
|
||||
response.should be_success
|
||||
end
|
||||
|
|
|
@ -208,8 +208,8 @@ describe TopicsController do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'forbidden to elders' do
|
||||
let!(:elder) { log_in(:elder) }
|
||||
describe 'forbidden to trust_level_4s' do
|
||||
let!(:trust_level_4) { log_in(:trust_level_4) }
|
||||
|
||||
it 'correctly denies' do
|
||||
xhr :post, :change_post_owners, topic_id: 111, username: 'user_a', post_ids: [1,2,3]
|
||||
|
|
|
@ -73,9 +73,9 @@ Fabricator(:leader, from: :user) do
|
|||
trust_level TrustLevel[3]
|
||||
end
|
||||
|
||||
Fabricator(:elder, from: :user) do
|
||||
name 'Elder McElderson'
|
||||
username { sequence(:username) { |i| "elder#{i}" } }
|
||||
email { sequence(:email) { |i| "elder#{i}@elderfun.com" } }
|
||||
Fabricator(:trust_level_4, from: :user) do
|
||||
name 'Leader McElderson'
|
||||
username { sequence(:username) { |i| "tl4#{i}" } }
|
||||
email { sequence(:email) { |i| "tl4#{i}@elderfun.com" } }
|
||||
trust_level TrustLevel[4]
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue