diff options
-rw-r--r-- | app/models/service.rb | 1 | ||||
-rw-r--r-- | features/project/service.feature | 8 | ||||
-rw-r--r-- | features/steps/project/services.rb | 8 | ||||
-rw-r--r-- | spec/models/project_services/slack_service/build_message_spec.rb | 2 | ||||
-rw-r--r-- | spec/workers/build_email_worker_spec.rb | 4 |
5 files changed, 12 insertions, 11 deletions
diff --git a/app/models/service.rb b/app/models/service.rb index 195c4690e8f..0ccb8b410d1 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -31,6 +31,7 @@ class Service < ActiveRecord::Base default_value_for :tag_push_events, true default_value_for :note_events, true default_value_for :build_events, true + default_value_for :properties, {} after_initialize :initialize_properties diff --git a/features/project/service.feature b/features/project/service.feature index 13edc6cb2b9..5014b52b9f6 100644 --- a/features/project/service.feature +++ b/features/project/service.feature @@ -55,11 +55,11 @@ Feature: Project Services And I fill Pushover settings Then I should see Pushover service settings saved - Scenario: Activate email service + Scenario: Activate email on push service When I visit project "Shop" services page - And I click email service link - And I fill email settings - Then I should see email service settings saved + And I click email on push service link + And I fill email on push settings + Then I should see email on push service settings saved Scenario: Activate Irker (IRC Gateway) service When I visit project "Shop" services page diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 2d564dac498..1c700df0c63 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -118,16 +118,16 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps expect(find_field('Restrict to branch').value).to eq 'master' end - step 'I click email service link' do - click_link 'Emails' + step 'I click email on push service link' do + click_link 'Emails on push' end - step 'I fill email settings' do + step 'I fill email on push settings' do fill_in 'Recipients', with: 'qa@company.name' click_button 'Save' end - step 'I should see email service settings saved' do + step 'I should see email on push service settings saved' do expect(find_field('Recipients').value).to eq 'qa@company.name' end diff --git a/spec/models/project_services/slack_service/build_message_spec.rb b/spec/models/project_services/slack_service/build_message_spec.rb index d64c67da938..621c83c0cda 100644 --- a/spec/models/project_services/slack_service/build_message_spec.rb +++ b/spec/models/project_services/slack_service/build_message_spec.rb @@ -25,7 +25,7 @@ describe SlackService::BuildMessage do let(:color) { 'good' } it 'returns a message with information about succeeded build' do - message = '<somewhere.com|project_name>: Commit <somewhere.com/commit/97de212e80737a608d939f648d959671fb0a0142/builds|97de212e> of <somewhere.com/commits/develop|develop> branch by hacker succeeded in 10 second(s)' + message = '<somewhere.com|project_name>: Commit <somewhere.com/commit/97de212e80737a608d939f648d959671fb0a0142/builds|97de212e> of <somewhere.com/commits/develop|develop> branch by hacker passed in 10 second(s)' expect(subject.pretext).to be_empty expect(subject.fallback).to eq(message) expect(subject.attachments).to eq([text: message, color: color]) diff --git a/spec/workers/build_email_worker_spec.rb b/spec/workers/build_email_worker_spec.rb index 7e379502f99..98deae0a588 100644 --- a/spec/workers/build_email_worker_spec.rb +++ b/spec/workers/build_email_worker_spec.rb @@ -16,7 +16,7 @@ describe BuildEmailWorker do describe "#perform" do it "sends mail" do - subject.perform(build.id, user.email, data.stringify_keys) + subject.perform(build.id, [user.email], data.stringify_keys) email = ActionMailer::Base.deliveries.last expect(email.subject).to include('Build success for') @@ -27,7 +27,7 @@ describe BuildEmailWorker do ActionMailer::Base.deliveries.clear allow(Notify).to receive(:build_success_email).and_raise(Net::SMTPFatalError) - subject.perform(build.id, user.email, data.stringify_keys) + subject.perform(build.id, [user.email], data.stringify_keys) expect(ActionMailer::Base.deliveries.count).to eq(0) end |