From b871564383cbade7fff312b8f045cee6c871f1e0 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 4 May 2017 12:46:03 +0200 Subject: fix service spec --- app/models/service.rb | 2 +- spec/models/service_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/service.rb b/app/models/service.rb index 18c046aff54..f8534387703 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -258,7 +258,7 @@ class Service < ActiveRecord::Base return false unless update_attributes(service_params) if service_params[:active] - PropagateProjectServiceWorker.perform_async(service_params[:id]) + PropagateProjectServiceWorker.perform_async(id) end true diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index 7a5fb509bf5..3a7d8b72993 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -258,7 +258,7 @@ describe Service, models: true do describe "#update_and_propagate" do let(:project) { create(:empty_project) } let!(:service) do - RedmineService.new( + RedmineService.create( project: project, active: false, properties: { @@ -270,7 +270,7 @@ describe Service, models: true do end it 'updates the service params successfully and calls the propagation worker' do - expect(PropagateProjectServiceWorker).to receive(:perform_async) + expect(PropagateProjectServiceWorker).to receive(:perform_async).with(service.id) expect(service.update_and_propagate(active: true)).to be true end -- cgit v1.2.1