docbrown/spec/models/mention_spec.rb
Kartikey Tanna 858ce184e5 Implement ActiveJob for Mention (#3055)
* Implemented ActiveJob for Mention#send_email_notification

* Implemented ActiveJob for Mention.create_all

* Fixed args while calling the job

* Changes as per the review
2019-06-13 11:05:22 -04:00

13 lines
450 B
Ruby

require "rails_helper"
RSpec.describe Mention, type: :model do
let(:user) { create(:user) }
let(:article) { create(:article, user_id: user.id) }
let(:comment) { create(:comment, user_id: user.id, commentable_id: article.id) }
it "calls on Mentions::CreateAllJob" do
described_class.create_all(comment) do
expect(Mentions::CreateAllJob).to have_received(:perform_later).with(comment.id, "Comment")
end
end
end