Fix specs

This commit is contained in:
Kamil Trzcinski 2015-12-10 16:16:34 +01:00
parent 80f8074d01
commit c4fa894de2
5 changed files with 12 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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])

View file

@ -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