Commit 94135e62 authored by Ilan Shamir's avatar Ilan Shamir

Remove JiraIssue model and replace references with ExternalIssue

parent 400b4159
...@@ -51,6 +51,7 @@ v 8.9.0 (unreleased) ...@@ -51,6 +51,7 @@ v 8.9.0 (unreleased)
- Projects pending deletion will render a 404 page - Projects pending deletion will render a 404 page
- Measure queue duration between gitlab-workhorse and Rails - Measure queue duration between gitlab-workhorse and Rails
- Make Omniauth providers specs to not modify global configuration - Make Omniauth providers specs to not modify global configuration
- Remove unused JiraIssue class and replace references with ExternalIssue
- Make authentication service for Container Registry to be compatible with < Docker 1.11 - Make authentication service for Container Registry to be compatible with < Docker 1.11
- Add Application Setting to configure Container Registry token expire delay (default 5min) - Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav - Cache assigned issue and merge request counts in sidebar nav
......
class JiraIssue < ExternalIssue
end
...@@ -33,9 +33,9 @@ describe MergeRequestsHelper do ...@@ -33,9 +33,9 @@ describe MergeRequestsHelper do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:issues) do let(:issues) do
[ [
JiraIssue.new('JIRA-123', project), ExternalIssue.new('JIRA-123', project),
JiraIssue.new('JIRA-456', project), ExternalIssue.new('JIRA-456', project),
JiraIssue.new('FOOBAR-7890', project) ExternalIssue.new('FOOBAR-7890', project)
] ]
end end
......
...@@ -105,7 +105,8 @@ describe Gitlab::ReferenceExtractor, lib: true do ...@@ -105,7 +105,8 @@ describe Gitlab::ReferenceExtractor, lib: true do
it 'returns JIRA issues for a JIRA-integrated project' do it 'returns JIRA issues for a JIRA-integrated project' do
subject.analyze('JIRA-123 and FOOBAR-4567') subject.analyze('JIRA-123 and FOOBAR-4567')
expect(subject.issues).to eq [JiraIssue.new('JIRA-123', project), JiraIssue.new('FOOBAR-4567', project)] expect(subject.issues).to eq [ExternalIssue.new('JIRA-123', project),
ExternalIssue.new('FOOBAR-4567', project)]
end end
end end
......
require 'spec_helper'
describe JiraIssue do
let(:project) { create(:project) }
subject { JiraIssue.new('JIRA-123', project) }
describe 'id' do
subject { super().id }
it { is_expected.to eq('JIRA-123') }
end
describe 'iid' do
subject { super().iid }
it { is_expected.to eq('JIRA-123') }
end
describe 'to_s' do
subject { super().to_s }
it { is_expected.to eq('JIRA-123') }
end
describe :== do
specify { expect(subject).to eq(JiraIssue.new('JIRA-123', project)) }
specify { expect(subject).not_to eq(JiraIssue.new('JIRA-124', project)) }
it 'only compares with JiraIssues' do
expect(subject).not_to eq('JIRA-123')
end
end
end
...@@ -76,7 +76,8 @@ describe JiraService, models: true do ...@@ -76,7 +76,8 @@ describe JiraService, models: true do
end end
it "should call JIRA API" do it "should call JIRA API" do
@jira_service.execute(merge_request, JiraIssue.new("JIRA-123", project)) @jira_service.execute(merge_request,
ExternalIssue.new("JIRA-123", project))
expect(WebMock).to have_requested(:post, @comment_url).with( expect(WebMock).to have_requested(:post, @comment_url).with(
body: /Issue solved with/ body: /Issue solved with/
).once ).once
...@@ -84,7 +85,8 @@ describe JiraService, models: true do ...@@ -84,7 +85,8 @@ describe JiraService, models: true do
it "calls the api with jira_issue_transition_id" do it "calls the api with jira_issue_transition_id" do
@jira_service.jira_issue_transition_id = 'this-is-a-custom-id' @jira_service.jira_issue_transition_id = 'this-is-a-custom-id'
@jira_service.execute(merge_request, JiraIssue.new("JIRA-123", project)) @jira_service.execute(merge_request,
ExternalIssue.new("JIRA-123", project))
expect(WebMock).to have_requested(:post, @api_url).with( expect(WebMock).to have_requested(:post, @api_url).with(
body: /this-is-a-custom-id/ body: /this-is-a-custom-id/
).once ).once
......
...@@ -529,7 +529,7 @@ describe SystemNoteService, services: true do ...@@ -529,7 +529,7 @@ describe SystemNoteService, services: true do
let(:author) { create(:user) } let(:author) { create(:user) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
let(:mergereq) { create(:merge_request, :simple, target_project: project, source_project: project) } let(:mergereq) { create(:merge_request, :simple, target_project: project, source_project: project) }
let(:jira_issue) { JiraIssue.new("JIRA-1", project)} let(:jira_issue) { ExternalIssue.new("JIRA-1", project)}
let(:jira_tracker) { project.create_jira_service if project.jira_service.nil? } let(:jira_tracker) { project.create_jira_service if project.jira_service.nil? }
let(:commit) { project.commit } let(:commit) { project.commit }
......
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