summaryrefslogtreecommitdiff
path: root/spec/models/service_spec.rb
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2016-11-16 12:46:07 +0100
committerAdam Niedzielski <adamsunday@gmail.com>2016-11-16 12:46:07 +0100
commitef3be00a0297dfa31002616df6ee49a0e2132cb7 (patch)
tree2316894b87a84db4ecb8ddcd96eba046aeb2a47b /spec/models/service_spec.rb
parent0f48abf24b0ba34aebfc1d0d52e9e22648b7da1a (diff)
downloadgitlab-ce-ef3be00a0297dfa31002616df6ee49a0e2132cb7.tar.gz
Defer saving project services to the database if there are no user changesadam-build-missing-services-when-necessary
Diffstat (limited to 'spec/models/service_spec.rb')
-rw-r--r--spec/models/service_spec.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb
index 43937a54b2c..b1615a95004 100644
--- a/spec/models/service_spec.rb
+++ b/spec/models/service_spec.rb
@@ -53,7 +53,7 @@ describe Service, models: true do
describe "Template" do
describe "for pushover service" do
- let(:service_template) do
+ let!(:service_template) do
PushoverService.create(
template: true,
properties: {
@@ -66,13 +66,9 @@ describe Service, models: true do
let(:project) { create(:project) }
describe 'is prefilled for projects pushover service' do
- before do
- service_template
- project.build_missing_services
- end
-
it "has all fields prefilled" do
- service = project.pushover_service
+ service = project.find_or_initialize_service('pushover')
+
expect(service.template).to eq(false)
expect(service.device).to eq('MyDevice')
expect(service.sound).to eq('mic')