summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-06-26 17:53:39 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-06-26 18:00:01 -0700
commite57d1bbf138aadd9c54a3e886d66d8b02e2497ae (patch)
tree723c43bedbb018ad9e19d13e1318ffe7f549cf93 /spec
parent9ca4a3988b494e667d1e8cd71a7ac2fb598f618d (diff)
downloadgitlab-ce-e57d1bbf138aadd9c54a3e886d66d8b02e2497ae.tar.gz
rm use of deprecated webmock api in jira model spec
Diffstat (limited to 'spec')
-rw-r--r--spec/models/project_services/jira_service_spec.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index e2b8226124f..c86f56c55eb 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -106,15 +106,15 @@ describe JiraService, models: true do
@jira_service.save
- project_issues_url = 'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123'
- @transitions_url = 'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123/transitions'
- @comment_url = 'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123/comment'
- @remote_link_url = 'http://gitlab_jira_username:gitlab_jira_password@jira.example.com/rest/api/2/issue/JIRA-123/remotelink'
-
- WebMock.stub_request(:get, project_issues_url)
- WebMock.stub_request(:post, @transitions_url)
- WebMock.stub_request(:post, @comment_url)
- WebMock.stub_request(:post, @remote_link_url)
+ project_issues_url = 'http://jira.example.com/rest/api/2/issue/JIRA-123'
+ @transitions_url = 'http://jira.example.com/rest/api/2/issue/JIRA-123/transitions'
+ @comment_url = 'http://jira.example.com/rest/api/2/issue/JIRA-123/comment'
+ @remote_link_url = 'http://jira.example.com/rest/api/2/issue/JIRA-123/remotelink'
+
+ WebMock.stub_request(:get, project_issues_url).with(basic_auth: %w(gitlab_jira_username gitlab_jira_password))
+ WebMock.stub_request(:post, @transitions_url).with(basic_auth: %w(gitlab_jira_username gitlab_jira_password))
+ WebMock.stub_request(:post, @comment_url).with(basic_auth: %w(gitlab_jira_username gitlab_jira_password))
+ WebMock.stub_request(:post, @remote_link_url).with(basic_auth: %w(gitlab_jira_username gitlab_jira_password))
end
it "calls JIRA API" do
@@ -202,9 +202,9 @@ describe JiraService, models: true do
end
def test_settings(api_url)
- project_url = "http://jira_username:jira_password@#{api_url}/rest/api/2/project/GitLabProject"
+ project_url = "http://#{api_url}/rest/api/2/project/GitLabProject"
- WebMock.stub_request(:get, project_url)
+ WebMock.stub_request(:get, project_url).with(basic_auth: %w(jira_username jira_password))
jira_service.test_settings
end