Commit c890f760 authored by Robert Speicher's avatar Robert Speicher Committed by Robert Speicher

Merge branch 'remove_jiraissue' into 'master'

Remove JiraIssue model and replace references with ExternalIssue

This MR Removes unused JiraIssue class and replaces references with ExternalIssue

Closes #18203 

See merge request !4659
parent 1d342204
......@@ -67,6 +67,7 @@ v 8.9.0 (unreleased)
- Measure queue duration between gitlab-workhorse and Rails
- Added Gfm autocomplete for labels
- 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
- Add Application Setting to configure Container Registry token expire delay (default 5min)
- Cache assigned issue and merge request counts in sidebar nav
......
class JiraIssue < ExternalIssue
end
......@@ -33,9 +33,9 @@ describe MergeRequestsHelper do
let(:project) { create(:project) }
let(:issues) do
[
JiraIssue.new('JIRA-123', project),
JiraIssue.new('JIRA-456', project),
JiraIssue.new('FOOBAR-7890', project)
ExternalIssue.new('JIRA-123', project),
ExternalIssue.new('JIRA-456', project),
ExternalIssue.new('FOOBAR-7890', project)
]
end
......
......@@ -105,7 +105,8 @@ describe Gitlab::ReferenceExtractor, lib: true do
it 'returns JIRA issues for a JIRA-integrated project' do
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
......
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
end
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(
body: /Issue solved with/
).once
......@@ -84,7 +85,8 @@ describe JiraService, models: true 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(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(
body: /this-is-a-custom-id/
).once
......
......@@ -529,7 +529,7 @@ describe SystemNoteService, services: true do
let(:author) { create(:user) }
let(:issue) { create(:issue, 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(: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