Commit 7db95489 authored by Marin Jankovski's avatar Marin Jankovski

Fix failing specs.

parent cab34dfb
......@@ -75,10 +75,11 @@ describe Gitlab::ReferenceExtractor do
it 'returns JIRA issues for a JIRA-integrated project' do
project.stub(jira_tracker?: true)
project.stub(default_issues_tracker?: false)
subject.analyze('JIRA-123 and FOOBAR-4567', project)
subject.issues_for(project).should eq(
[JiraIssue.new('JIRA-123'), JiraIssue.new('FOOBAR-4567')]
[JiraIssue.new('JIRA-123', project), JiraIssue.new('FOOBAR-4567', project)]
)
end
......
require 'spec_helper'
describe JiraIssue do
subject { JiraIssue.new('JIRA-123') }
let(:project) { create(:project) }
subject { JiraIssue.new('JIRA-123', project) }
its(:id) { should eq('JIRA-123') }
its(:iid) { should eq('JIRA-123') }
its(:to_s) { should eq('JIRA-123') }
describe :== do
specify { subject.should eq(JiraIssue.new('JIRA-123')) }
specify { subject.should_not eq(JiraIssue.new('JIRA-124')) }
specify { subject.should eq(JiraIssue.new('JIRA-123', project)) }
specify { subject.should_not eq(JiraIssue.new('JIRA-124', project)) }
it 'only compares with JiraIssues' do
subject.should_not eq('JIRA-123')
......
......@@ -115,8 +115,8 @@ describe MergeRequest do
end
context 'for a project with JIRA integration' do
let(:issue0) { JiraIssue.new('JIRA-123') }
let(:issue1) { JiraIssue.new('FOOBAR-4567') }
let(:issue0) { JiraIssue.new('JIRA-123', subject.project) }
let(:issue1) { JiraIssue.new('FOOBAR-4567', subject.project) }
it 'returns sorted JiraIssues' do
subject.project.stub(default_branch: subject.target_branch)
......
......@@ -43,7 +43,7 @@ describe JiraService do
end
it "should call JIRA API" do
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123"))
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123", project))
WebMock.should have_requested(:post, @api_url).with(
body: /Issue solved with/
).once
......@@ -51,7 +51,7 @@ describe JiraService do
it "calls the api with jira_issue_transition_id" do
@jira_service.jira_issue_transition_id = 'this-is-a-custom-id'
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123"))
@jira_service.execute(@sample_data, JiraIssue.new("JIRA-123", project))
WebMock.should have_requested(:post, @api_url).with(
body: /this-is-a-custom-id/
).once
......
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