Commit ff72de88 authored by http://jneen.net/'s avatar http://jneen.net/

remove use of deprecated webmock feature in jira specs

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