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

Address MR comments

parent a678f42e
......@@ -30,4 +30,8 @@ class DeploymentService < Service
def terminals(environment)
raise NotImplementedError
end
def can_test?
false
end
end
......@@ -91,7 +91,7 @@ class JiraService < IssueTrackerService
{ type: 'text', name: 'project_key', placeholder: 'Project Key', required: true },
{ type: 'text', name: 'username', 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
......
......@@ -80,4 +80,8 @@ class MockCiService < CiService
:error
end
end
def can_test?
false
end
end
......@@ -14,4 +14,8 @@ class MockMonitoringService < MonitoringService
def metrics(environment)
JSON.parse(File.read(Rails.root + 'spec/fixtures/metrics.json'))
end
def can_test?
false
end
end
......@@ -58,9 +58,6 @@ describe Projects::ServicesController do
expect(response.status).to eq(200)
end
def built_service
end
end
context 'failure' do
......
......@@ -47,6 +47,18 @@ feature 'Setup Jira service', :feature, :js do
WebMock.stub_request(:get, project_url).to_return(status: 401)
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
click_link('JIRA')
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