mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Added spec for topic status update event
This commit is contained in:
parent
9e46690086
commit
186a9630b7
1 changed files with 16 additions and 0 deletions
|
@ -1584,4 +1584,20 @@ describe Topic do
|
||||||
|
|
||||||
expect(topic.message_archived?(user)).to eq(true)
|
expect(topic.message_archived?(user)).to eq(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'will trigger :topic_status_updated' do
|
||||||
|
topic = Fabricate(:topic)
|
||||||
|
user = topic.user
|
||||||
|
user.admin = true
|
||||||
|
@topic_status_event_triggered = false
|
||||||
|
|
||||||
|
DiscourseEvent.on(:topic_status_updated) do
|
||||||
|
@topic_status_event_triggered = true
|
||||||
|
end
|
||||||
|
|
||||||
|
topic.update_status('closed', true, user)
|
||||||
|
topic.reload
|
||||||
|
|
||||||
|
expect(@topic_status_event_triggered).to eq(true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue