From d2e02224cb4b8b340631edf29aa842e386fc7f1e Mon Sep 17 00:00:00 2001 From: Grzegorz Bizon Date: Tue, 5 Sep 2017 10:04:40 +0200 Subject: [PATCH] Optimize generic specs for services --- spec/requests/api/services_spec.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb index 48d99841385..7e174903918 100644 --- a/spec/requests/api/services_spec.rb +++ b/spec/requests/api/services_spec.rb @@ -1,10 +1,13 @@ require "spec_helper" describe API::Services do - let(:user) { create(:user) } - let(:admin) { create(:admin) } - let(:user2) { create(:user) } - let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) } + set(:user) { create(:user) } + set(:admin) { create(:admin) } + set(:user2) { create(:user) } + + set(:project) do + create(:project, creator_id: user.id, namespace: user.namespace) + end Service.available_services_names.each do |service| describe "PUT /projects/:id/services/#{service.dasherize}" do @@ -98,8 +101,6 @@ describe API::Services do end describe 'POST /projects/:id/services/:slug/trigger' do - let!(:project) { create(:project) } - describe 'Mattermost Service' do let(:service_name) { 'mattermost_slash_commands' }