diff --git a/spec/models/issue_trackers/redmine_tracker_spec.rb b/spec/models/issue_trackers/redmine_tracker_spec.rb index 33c6da2..85bc05a 100644 --- a/spec/models/issue_trackers/redmine_tracker_spec.rb +++ b/spec/models/issue_trackers/redmine_tracker_spec.rb @@ -8,13 +8,17 @@ describe IssueTrackers::RedmineTracker do number = 5 @issue_link = "#{tracker.account}/issues/#{number}.xml?project_id=#{tracker.project_id}" body = "my subject#{number}" - stub_request(:post, "#{tracker.account}/issues.xml"). + + # Build base url with account URL, and username/password basic auth + base_url = tracker.account.gsub /http:\/\//, "http://#{tracker.username}:#{tracker.password}@" + + stub_request(:post, "#{base_url}/issues.xml"). to_return(:status => 201, :headers => {'Location' => @issue_link}, :body => body ) problem.app.issue_tracker.create_issue(problem) problem.reload - requested = have_requested(:post, "#{tracker.account}/issues.xml") + requested = have_requested(:post, "#{base_url}/issues.xml") WebMock.should requested.with(:headers => {'X-Redmine-API-Key' => tracker.api_token}) WebMock.should requested.with(:body => /#{tracker.project_id}<\/project-id>/) WebMock.should requested.with(:body => /\[#{ problem.environment }\]\[#{problem.where}\] #{problem.message.to_s.truncate(100)}<\/subject>/) @@ -39,4 +43,3 @@ describe IssueTrackers::RedmineTracker do 'http://redmine.example.com/projects/actual_project/repository/annotate/example/file#L25' end end - -- libgit2 0.21.2