mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: PM should never be allowed to have a category
FIX: TL3 should not be allowed to muck with PM titles
This commit is contained in:
@ -108,17 +108,18 @@ describe Invite do
|
||||
end
|
||||
|
||||
context 'an existing user' do
|
||||
let(:topic) { Fabricate(:topic, archetype: Archetype.private_message) }
|
||||
let(:topic) { Fabricate(:topic, category_id: nil, archetype: 'private_message') }
|
||||
let(:coding_horror) { Fabricate(:coding_horror) }
|
||||
let!(:invite) { topic.invite_by_email(topic.user, coding_horror.email) }
|
||||
|
||||
it "doesn't create an invite" do
|
||||
it "works" do
|
||||
# doesn't create an invite
|
||||
invite.should be_blank
|
||||
end
|
||||
|
||||
it "gives the user permission to access the topic" do
|
||||
# gives the user permission to access the topic
|
||||
topic.allowed_users.include?(coding_horror).should be_true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context '.redeem' do
|
||||
@ -254,7 +255,7 @@ describe Invite do
|
||||
let!(:user) { invite.redeem }
|
||||
|
||||
let(:coding_horror) { User.find_by(username: "CodingHorror") }
|
||||
let(:another_topic) { Fabricate(:topic, archetype: "private_message", user: coding_horror) }
|
||||
let(:another_topic) { Fabricate(:topic, category_id: nil, archetype: "private_message", user: coding_horror) }
|
||||
|
||||
it 'adds the user to the topic_users of the first topic' do
|
||||
topic.allowed_users.include?(user).should be_true
|
||||
|
Reference in New Issue
Block a user