Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-06-27 03:43:26 +0300
committerhttp://jneen.net/ <jneen@jneen.net>2017-06-27 04:00:01 +0300
commitff72de88bbc0d3c2681620fb576bf0e8379bdb42 (patch)
tree59e4ea1155f71e19d7b4c381b11b41a12b94ae2f /spec
parentc8dfdfcda353d438f5cbdef0acc2e7898ef9a136 (diff)
remove use of deprecated webmock feature in jira specs
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/services/jira_service_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/features/projects/services/jira_service_spec.rb b/spec/features/projects/services/jira_service_spec.rb
index 2ea50e8f672..bf2ee2a10b1 100644
--- a/spec/features/projects/services/jira_service_spec.rb
+++ b/spec/features/projects/services/jira_service_spec.rb
@@ -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')