Fix broken specs.

This commit is contained in:
Guo Xiang Tan 2017-03-16 15:05:28 +08:00
parent bf78c228f4
commit 5169ef8814
2 changed files with 1 additions and 5 deletions

View File

@ -1065,7 +1065,7 @@ class User < ActiveRecord::Base
end
def trigger_user_created_event
DiscourseEvent.trigger(:user_created, self)
DiscourseEvent.trigger(:user_created, self) if self.new_record?
true
end

View File

@ -4,9 +4,6 @@ require 'topic_subtype'
describe PostCreator do
before do
end
let(:user) { Fabricate(:user) }
let(:topic) { Fabricate(:topic, user: user) }
@ -80,7 +77,6 @@ describe PostCreator do
end
it "triggers extensibility events" do
creator # bypass a user_created event, can be removed when there is a UserCreator
DiscourseEvent.expects(:trigger).with(:before_create_post, anything).once
DiscourseEvent.expects(:trigger).with(:validate_post, anything).once
DiscourseEvent.expects(:trigger).with(:topic_created, anything, anything, user).once