Commit 84c68bb1 authored by Jarka Kadlecova's avatar Jarka Kadlecova

Address MR comments

parent a678f42e
...@@ -30,4 +30,8 @@ class DeploymentService < Service ...@@ -30,4 +30,8 @@ class DeploymentService < Service
def terminals(environment) def terminals(environment)
raise NotImplementedError raise NotImplementedError
end end
def can_test?
false
end
end end
...@@ -91,7 +91,7 @@ class JiraService < IssueTrackerService ...@@ -91,7 +91,7 @@ class JiraService < IssueTrackerService
{ type: 'text', name: 'project_key', placeholder: 'Project Key', required: true }, { type: 'text', name: 'project_key', placeholder: 'Project Key', required: true },
{ type: 'text', name: 'username', placeholder: '', required: true }, { type: 'text', name: 'username', placeholder: '', required: true },
{ type: 'password', name: 'password', placeholder: '', required: true }, { type: 'password', name: 'password', placeholder: '', required: true },
{ type: 'text', name: 'jira_issue_transition_id', placeholder: '', required: true } { type: 'text', name: 'jira_issue_transition_id', placeholder: '' }
] ]
end end
......
...@@ -80,4 +80,8 @@ class MockCiService < CiService ...@@ -80,4 +80,8 @@ class MockCiService < CiService
:error :error
end end
end end
def can_test?
false
end
end end
...@@ -14,4 +14,8 @@ class MockMonitoringService < MonitoringService ...@@ -14,4 +14,8 @@ class MockMonitoringService < MonitoringService
def metrics(environment) def metrics(environment)
JSON.parse(File.read(Rails.root + 'spec/fixtures/metrics.json')) JSON.parse(File.read(Rails.root + 'spec/fixtures/metrics.json'))
end end
def can_test?
false
end
end end
...@@ -58,9 +58,6 @@ describe Projects::ServicesController do ...@@ -58,9 +58,6 @@ describe Projects::ServicesController do
expect(response.status).to eq(200) expect(response.status).to eq(200)
end end
def built_service
end
end end
context 'failure' do context 'failure' do
......
...@@ -47,6 +47,18 @@ feature 'Setup Jira service', :feature, :js do ...@@ -47,6 +47,18 @@ feature 'Setup Jira service', :feature, :js do
WebMock.stub_request(:get, project_url).to_return(status: 401) WebMock.stub_request(:get, project_url).to_return(status: 401)
end end
it 'shows errors when some required fields are not filled in' do
click_link('JIRA')
check 'Active'
fill_in 'service_password', with: 'password'
click_button('Test settings and save changes')
page.within('.service-settings') do
expect(page).to have_content('This field is required.')
end
end
it 'activates the JIRA service' do it 'activates the JIRA service' do
click_link('JIRA') click_link('JIRA')
fill_form fill_form
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment