Commit b8715643 authored by James Lopez's avatar James Lopez

fix service spec

parent 3bff8da8
...@@ -258,7 +258,7 @@ class Service < ActiveRecord::Base ...@@ -258,7 +258,7 @@ class Service < ActiveRecord::Base
return false unless update_attributes(service_params) return false unless update_attributes(service_params)
if service_params[:active] if service_params[:active]
PropagateProjectServiceWorker.perform_async(service_params[:id]) PropagateProjectServiceWorker.perform_async(id)
end end
true true
......
...@@ -258,7 +258,7 @@ describe Service, models: true do ...@@ -258,7 +258,7 @@ describe Service, models: true do
describe "#update_and_propagate" do describe "#update_and_propagate" do
let(:project) { create(:empty_project) } let(:project) { create(:empty_project) }
let!(:service) do let!(:service) do
RedmineService.new( RedmineService.create(
project: project, project: project,
active: false, active: false,
properties: { properties: {
...@@ -270,7 +270,7 @@ describe Service, models: true do ...@@ -270,7 +270,7 @@ describe Service, models: true do
end end
it 'updates the service params successfully and calls the propagation worker' do 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 expect(service.update_and_propagate(active: true)).to be true
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment