diff --git a/spec/services/persister/post_persister_spec.rb b/spec/services/persister/post_persister_spec.rb index 3f969fa9c..16058b963 100644 --- a/spec/services/persister/post_persister_spec.rb +++ b/spec/services/persister/post_persister_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Persister::PostPersister do +RSpec.describe Persister::PostPersister do let(:organization) { Fabricate(:organization) } let(:user) { Fabricate(:user) } let(:category) { Fabricate(:category) } @@ -32,11 +32,12 @@ context 'background job' do before do allow(::Event).to receive(:create!).and_return(event) - persister.save end it 'enqueues a CreatePushNotificationsJob background job' do - expect(CreatePushNotificationsJob).to have_been_enqueued.with(event_id: 27) + expect { + persister.save + }.to enqueue_job(CreatePushNotificationsJob).with(event_id: 27) end end end @@ -57,11 +58,12 @@ context 'background job' do before do allow(::Event).to receive(:create!).and_return(event) - persister.update_attributes(title: 'New title') end it 'enqueues a CreatePushNotificationsJob background job' do - expect(CreatePushNotificationsJob).to have_been_enqueued.with(event_id: 27) + expect { + persister.update_attributes(title: 'New title') + }.to enqueue_job(CreatePushNotificationsJob).with(event_id: 27) end end end