remove use of deprecated webmock feature in jira specs

This commit is contained in:
http://jneen.net/ 2017-06-26 17:43:26 -07:00
parent c8dfdfcda3
commit ff72de88bb
1 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,11 @@ feature 'Setup Jira service', :feature, :js do
let(:service) { project.create_jira_service }
let(:url) { 'http://jira.example.com' }
let(:project_url) { 'http://username:password@jira.example.com/rest/api/2/project/GitLabProject' }
def stub_project_url
WebMock.stub_request(:get, 'http://jira.example.com/rest/api/2/project/GitLabProject')
.with(basic_auth: %w(username password))
end
def fill_form(active = true)
check 'Active' if active
@ -27,9 +31,7 @@ feature 'Setup Jira service', :feature, :js do
describe 'user sets and activates Jira Service' do
context 'when Jira connection test succeeds' do
before do
WebMock.stub_request(:get, project_url)
end
before { stub_project_url }
it 'activates the JIRA service' do
click_link('JIRA')
@ -43,9 +45,7 @@ feature 'Setup Jira service', :feature, :js do
end
context 'when Jira connection test fails' do
before do
WebMock.stub_request(:get, project_url).to_return(status: 401)
end
before { stub_project_url.to_return(status: 401) }
it 'shows errors when some required fields are not filled in' do
click_link('JIRA')