mirror of
https://github.com/discourse/discourse.git
synced 2025-09-08 12:06:51 +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:
parent
f95611aba1
commit
0f585bcdbe
14 changed files with 47 additions and 19 deletions
|
@ -39,7 +39,7 @@ describe Draft do
|
|||
it 'nukes new topic draft after a topic is created' do
|
||||
u = Fabricate(:user)
|
||||
Draft.set(u, Draft::NEW_TOPIC, 0, 'my draft')
|
||||
t = Fabricate(:topic, user: u)
|
||||
_t = Fabricate(:topic, user: u)
|
||||
s = DraftSequence.current(u, Draft::NEW_TOPIC)
|
||||
Draft.get(u, Draft::NEW_TOPIC, s).should be_nil
|
||||
end
|
||||
|
@ -47,7 +47,7 @@ describe Draft do
|
|||
it 'nukes new pm draft after a pm is created' do
|
||||
u = Fabricate(:user)
|
||||
Draft.set(u, Draft::NEW_PRIVATE_MESSAGE, 0, 'my draft')
|
||||
t = Fabricate(:topic, user: u, archetype: Archetype.private_message)
|
||||
t = Fabricate(:topic, user: u, archetype: Archetype.private_message, category_id: nil)
|
||||
s = DraftSequence.current(t.user, Draft::NEW_PRIVATE_MESSAGE)
|
||||
Draft.get(u, Draft::NEW_PRIVATE_MESSAGE, s).should be_nil
|
||||
end
|
||||
|
@ -55,7 +55,7 @@ describe Draft do
|
|||
it 'does not nuke new topic draft after a pm is created' do
|
||||
u = Fabricate(:user)
|
||||
Draft.set(u, Draft::NEW_TOPIC, 0, 'my draft')
|
||||
t = Fabricate(:topic, user: u, archetype: Archetype.private_message)
|
||||
t = Fabricate(:topic, user: u, archetype: Archetype.private_message, category_id: nil)
|
||||
s = DraftSequence.current(t.user, Draft::NEW_TOPIC)
|
||||
Draft.get(u, Draft::NEW_TOPIC, s).should == 'my draft'
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue