require 'spec_helper' describe IssueTrackers::BitbucketIssuesTracker do it "should create an issue on BitBucket Issues with problem params, and set issue link for problem" do repo = "test_user/test_repo" notice = Fabricate :notice notice.app.bitbucket_repo = repo tracker = Fabricate :bitbucket_issues_tracker, :app => notice.app problem = notice.problem number = 123 @issue_link = "https://bitbucket.org/#{repo}/issue/#{number}/" body = < 200, :headers => {}, :body => body ) problem.app.issue_tracker.create_issue(problem) problem.reload requested = have_requested(:post, "https://#{tracker.api_token}:#{tracker.project_id}@bitbucket.org/api/1.0/repositories/test_user/test_repo/issues/") WebMock.should requested.with(:title => /[production][foo#bar] FooError: Too Much Bar/) WebMock.should requested.with(:content => /See this exception on Errbit/) problem.issue_link.should == @issue_link end end