Add restrict_to_branch to service controller

And add restrict_to_branch to spec
This commit is contained in:
Jeremy 2015-01-16 12:49:50 +01:00
parent b4d9ceb26f
commit 3cd1eda5a4
3 changed files with 6 additions and 2 deletions

View file

@ -47,7 +47,7 @@ class Projects::ServicesController < Projects::ApplicationController
:room, :recipients, :project_url, :webhook,
:user_key, :device, :priority, :sound, :bamboo_url, :username, :password,
:build_key, :server, :teamcity_url, :build_type,
:description, :issues_url, :new_issue_url
:description, :issues_url, :new_issue_url, :restrict_to_branch
)
end
end

View file

@ -110,11 +110,13 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps
step 'I fill Asana settings' do
check 'Active'
fill_in 'Api key', with: 'verySecret'
fill_in 'Restrict to branch', with: 'master'
click_button 'Save'
end
step 'I should see Asana service settings saved' do
find_field('Api key').value.should == 'verySecret'
find_field('Restrict to branch').value.should == 'master'
end
step 'I click email on push service link' do

View file

@ -27,6 +27,7 @@ describe AsanaService, models: true do
end
it { should validate_presence_of :api_key }
it { should validate_presence_of :restrict_to_branch }
end
end
@ -40,7 +41,8 @@ describe AsanaService, models: true do
project: project,
project_id: project.id,
service_hook: true,
api_key: 'verySecret'
api_key: 'verySecret',
restrict_to_branch: 'master'
)
end