mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
change "visitor" trust level to "new user"
I blame me for this mistake.. visitor means other stuff in practice. New User is correct meaning.
This commit is contained in:
@ -4,8 +4,8 @@ require 'post_revisor'
|
||||
describe PostRevisor do
|
||||
|
||||
let(:topic) { Fabricate(:topic) }
|
||||
let(:visitor) { Fabricate(:visitor) }
|
||||
let(:post_args) { {user: visitor, topic: topic} }
|
||||
let(:newuser) { Fabricate(:newuser) }
|
||||
let(:post_args) { {user: newuser, topic: topic} }
|
||||
|
||||
context 'revise' do
|
||||
let(:post) { Fabricate(:post, post_args) }
|
||||
@ -186,7 +186,7 @@ describe PostRevisor do
|
||||
end
|
||||
end
|
||||
|
||||
describe "admin editing a visitor's post" do
|
||||
describe "admin editing a new user's post" do
|
||||
let(:changed_by) { Fabricate(:admin) }
|
||||
|
||||
before do
|
||||
@ -194,18 +194,18 @@ describe PostRevisor do
|
||||
subject.revise!(changed_by, "So, post them here!\nhttp://i.imgur.com/FGg7Vzu.gif")
|
||||
end
|
||||
|
||||
it "allows an admin to insert images into a visitor's post" do
|
||||
it "allows an admin to insert images into a new user's post" do
|
||||
post.errors.should be_blank
|
||||
end
|
||||
end
|
||||
|
||||
describe "visitor editing their own post" do
|
||||
describe "new user editing their own post" do
|
||||
before do
|
||||
SiteSetting.stubs(:too_many_images).returns(0)
|
||||
subject.revise!(post.user, "So, post them here!\nhttp://i.imgur.com/FGg7Vzu.gif")
|
||||
end
|
||||
|
||||
it "allows an admin to insert images into a visitor's post" do
|
||||
it "allows an admin to insert images into a new user's post" do
|
||||
post.errors.should be_present
|
||||
end
|
||||
|
||||
|
@ -3,9 +3,9 @@ require 'promotion'
|
||||
|
||||
describe Promotion do
|
||||
|
||||
context "visitor" do
|
||||
context "newuser" do
|
||||
|
||||
let(:user) { Fabricate(:user, trust_level: TrustLevel.levels[:visitor])}
|
||||
let(:user) { Fabricate(:user, trust_level: TrustLevel.levels[:newuser])}
|
||||
let(:promotion) { Promotion.new(user) }
|
||||
|
||||
it "doesn't raise an error with a nil user" do
|
||||
@ -20,7 +20,7 @@ describe Promotion do
|
||||
end
|
||||
|
||||
it "has not changed the user's trust level" do
|
||||
user.trust_level.should == TrustLevel.levels[:visitor]
|
||||
user.trust_level.should == TrustLevel.levels[:newuser]
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user