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:
Sam
2014-09-11 17:39:20 +10:00
parent f95611aba1
commit 0f585bcdbe
14 changed files with 47 additions and 19 deletions

View File

@ -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