diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/requests/api/markdown_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/requests/api/markdown_spec.rb')
-rw-r--r-- | spec/requests/api/markdown_spec.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/spec/requests/api/markdown_spec.rb b/spec/requests/api/markdown_spec.rb index 09342b06744..53e43430b1f 100644 --- a/spec/requests/api/markdown_spec.rb +++ b/spec/requests/api/markdown_spec.rb @@ -52,6 +52,7 @@ describe API::Markdown do context "when arguments are valid" do let_it_be(:project) { create(:project) } let_it_be(:issue) { create(:issue, project: project) } + let(:issue_url) { "http://#{Gitlab.config.gitlab.host}/#{issue.project.namespace.path}/#{issue.project.path}/-/issues/#{issue.iid}" } let(:text) { ":tada: Hello world! :100: #{issue.to_reference}" } context "when not using gfm" do @@ -88,7 +89,7 @@ describe API::Markdown do .and include('data-name="tada"') .and include('data-name="100"') .and include("#1") - .and exclude("<a href=\"#{IssuesHelper.url_for_issue(issue.iid, project)}\"") + .and exclude("<a href=\"#{issue_url}\"") .and exclude("#1</a>") end end @@ -104,16 +105,16 @@ describe API::Markdown do expect(json_response["html"]).to include("Hello world!") .and include('data-name="tada"') .and include('data-name="100"') - .and include("<a href=\"#{IssuesHelper.url_for_issue(issue.iid, project)}\"") + .and include("<a href=\"#{issue_url}\"") .and include("#1</a>") end end context 'with a public project and confidential issue' do - let(:public_project) { create(:project, :public) } - let(:confidential_issue) { create(:issue, :confidential, project: public_project, title: 'Confidential title') } + let(:public_project) { create(:project, :public) } + let(:issue) { create(:issue, :confidential, project: public_project, title: 'Confidential title') } - let(:text) { ":tada: Hello world! :100: #{confidential_issue.to_reference}" } + let(:text) { ":tada: Hello world! :100: #{issue.to_reference}" } let(:params) { { text: text, gfm: true, project: public_project.full_path } } shared_examples 'user without proper access' do @@ -141,7 +142,7 @@ describe API::Markdown do end context 'when logged in as author' do - let(:user) { confidential_issue.author } + let(:user) { issue.author } it 'renders the title or link' do expect(response).to have_gitlab_http_status(:created) @@ -149,7 +150,7 @@ describe API::Markdown do expect(json_response["html"]).to include('Hello world!') .and include('data-name="tada"') .and include('data-name="100"') - .and include("<a href=\"#{IssuesHelper.url_for_issue(confidential_issue.iid, public_project)}\"") + .and include("<a href=\"#{issue_url}\"") .and include("#1</a>") end end |