summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-05-04 12:46:03 +0200
committerJames Lopez <james@jameslopez.es>2017-05-04 12:46:03 +0200
commitb871564383cbade7fff312b8f045cee6c871f1e0 (patch)
tree9ce39bc498e29a208e6a6b9b4181db7c72ab4bf0
parent3bff8da8c1e3223e81bccd5343902b840f005fcf (diff)
downloadgitlab-ce-b871564383cbade7fff312b8f045cee6c871f1e0.tar.gz
fix service spec
-rw-r--r--app/models/service.rb2
-rw-r--r--spec/models/service_spec.rb4
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