diff options
Diffstat (limited to 'spec/models/project_services/gitlab_issue_tracker_service_spec.rb')
-rw-r--r-- | spec/models/project_services/gitlab_issue_tracker_service_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb index d45e0a441d4..45cc78c8ff4 100644 --- a/spec/models/project_services/gitlab_issue_tracker_service_spec.rb +++ b/spec/models/project_services/gitlab_issue_tracker_service_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe GitlabIssueTrackerService, models: true do +describe GitlabIssueTrackerService do describe "Associations" do it { is_expected.to belong_to :project } it { is_expected.to have_one :service_hook } @@ -27,25 +27,25 @@ describe GitlabIssueTrackerService, models: true do context 'with absolute urls' do before do - allow(GitlabIssueTrackerService).to receive(:default_url_options).and_return(script_name: "/gitlab/root") + allow(described_class).to receive(:default_url_options).and_return(script_name: "/gitlab/root") end it 'gives the correct path' do - expect(service.project_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.path_with_namespace}/issues") - expect(service.new_issue_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.path_with_namespace}/issues/new") - expect(service.issue_url(432)).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.path_with_namespace}/issues/432") + expect(service.project_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues") + expect(service.new_issue_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues/new") + expect(service.issue_url(432)).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues/432") end end context 'with relative urls' do before do - allow(GitlabIssueTrackerService).to receive(:default_url_options).and_return(script_name: "/gitlab/root") + allow(described_class).to receive(:default_url_options).and_return(script_name: "/gitlab/root") end it 'gives the correct path' do - expect(service.issue_tracker_path).to eq("/gitlab/root/#{project.path_with_namespace}/issues") - expect(service.new_issue_path).to eq("/gitlab/root/#{project.path_with_namespace}/issues/new") - expect(service.issue_path(432)).to eq("/gitlab/root/#{project.path_with_namespace}/issues/432") + expect(service.issue_tracker_path).to eq("/gitlab/root/#{project.full_path}/issues") + expect(service.new_issue_path).to eq("/gitlab/root/#{project.full_path}/issues/new") + expect(service.issue_path(432)).to eq("/gitlab/root/#{project.full_path}/issues/432") end end end |