diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-10 21:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-10 21:08:01 +0000 |
commit | 4ba55564e1dd7fdbdb89065be8eefd01d8c2d607 (patch) | |
tree | 32e6eaec4cf44b40607e3fd8c4077050c3ce9771 /spec/helpers | |
parent | 115c8ea7af7ef69ca3f09c333314546e9b5712f9 (diff) | |
download | gitlab-ce-4ba55564e1dd7fdbdb89065be8eefd01d8c2d607.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/gitlab_routing_helper_spec.rb | 56 | ||||
-rw-r--r-- | spec/helpers/issuables_helper_spec.rb | 20 | ||||
-rw-r--r-- | spec/helpers/snippets_helper_spec.rb | 12 |
3 files changed, 54 insertions, 34 deletions
diff --git a/spec/helpers/gitlab_routing_helper_spec.rb b/spec/helpers/gitlab_routing_helper_spec.rb index 9cc1a9dfd5b..e76ebcb5637 100644 --- a/spec/helpers/gitlab_routing_helper_spec.rb +++ b/spec/helpers/gitlab_routing_helper_spec.rb @@ -118,91 +118,91 @@ describe GitlabRoutingHelper do let_it_be(:project_snippet) { create(:project_snippet) } let_it_be(:note) { create(:note_on_personal_snippet, noteable: personal_snippet) } - describe '#snippet_path' do + describe '#gitlab_snippet_path' do it 'returns the personal snippet path' do - expect(snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}") + expect(gitlab_snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}") end it 'returns the project snippet path' do - expect(snippet_path(project_snippet)).to eq("/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}") + expect(gitlab_snippet_path(project_snippet)).to eq("/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}") end end - describe '#snippet_url' do + describe '#gitlab_snippet_url' do it 'returns the personal snippet url' do - expect(snippet_url(personal_snippet)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}") + expect(gitlab_snippet_url(personal_snippet)).to eq("http://test.host/snippets/#{personal_snippet.id}") end it 'returns the project snippet url' do - expect(snippet_url(project_snippet)).to eq("#{Settings.gitlab['url']}/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}") + expect(gitlab_snippet_url(project_snippet)).to eq("http://test.host/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}") end end - describe '#raw_snippet_path' do + describe '#gitlab_raw_snippet_path' do it 'returns the raw personal snippet path' do - expect(raw_snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/raw") + expect(gitlab_raw_snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/raw") end it 'returns the raw project snippet path' do - expect(raw_snippet_path(project_snippet)).to eq("/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}/raw") + expect(gitlab_raw_snippet_path(project_snippet)).to eq("/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}/raw") end end - describe '#raw_snippet_url' do + describe '#gitlab_raw_snippet_url' do it 'returns the raw personal snippet url' do - expect(raw_snippet_url(personal_snippet)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}/raw") + expect(gitlab_raw_snippet_url(personal_snippet)).to eq("http://test.host/snippets/#{personal_snippet.id}/raw") end it 'returns the raw project snippet url' do - expect(raw_snippet_url(project_snippet)).to eq("#{Settings.gitlab['url']}/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}/raw") + expect(gitlab_raw_snippet_url(project_snippet)).to eq("http://test.host/#{project_snippet.project.full_path}/snippets/#{project_snippet.id}/raw") end end - describe '#snippet_notes_path' do + describe '#gitlab_snippet_notes_path' do it 'returns the notes path for the personal snippet' do - expect(snippet_notes_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/notes") + expect(gitlab_snippet_notes_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/notes") end end - describe '#snippet_notes_url' do + describe '#gitlab_snippet_notes_url' do it 'returns the notes url for the personal snippet' do - expect(snippet_notes_url(personal_snippet)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}/notes") + expect(gitlab_snippet_notes_url(personal_snippet)).to eq("http://test.host/snippets/#{personal_snippet.id}/notes") end end - describe '#snippet_note_path' do + describe '#gitlab_snippet_note_path' do it 'returns the note path for the personal snippet' do - expect(snippet_note_path(personal_snippet, note)).to eq("/snippets/#{personal_snippet.id}/notes/#{note.id}") + expect(gitlab_snippet_note_path(personal_snippet, note)).to eq("/snippets/#{personal_snippet.id}/notes/#{note.id}") end end - describe '#snippet_note_url' do + describe '#gitlab_snippet_note_url' do it 'returns the note url for the personal snippet' do - expect(snippet_note_url(personal_snippet, note)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}/notes/#{note.id}") + expect(gitlab_snippet_note_url(personal_snippet, note)).to eq("http://test.host/snippets/#{personal_snippet.id}/notes/#{note.id}") end end - describe '#toggle_award_emoji_snippet_note_path' do + describe '#gitlab_toggle_award_emoji_snippet_note_path' do it 'returns the note award emoji path for the personal snippet' do - expect(toggle_award_emoji_snippet_note_path(personal_snippet, note)).to eq("/snippets/#{personal_snippet.id}/notes/#{note.id}/toggle_award_emoji") + expect(gitlab_toggle_award_emoji_snippet_note_path(personal_snippet, note)).to eq("/snippets/#{personal_snippet.id}/notes/#{note.id}/toggle_award_emoji") end end - describe '#toggle_award_emoji_snippet_note_url' do + describe '#gitlab_toggle_award_emoji_snippet_note_url' do it 'returns the note award emoji url for the personal snippet' do - expect(toggle_award_emoji_snippet_note_url(personal_snippet, note)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}/notes/#{note.id}/toggle_award_emoji") + expect(gitlab_toggle_award_emoji_snippet_note_url(personal_snippet, note)).to eq("http://test.host/snippets/#{personal_snippet.id}/notes/#{note.id}/toggle_award_emoji") end end - describe '#toggle_award_emoji_snippet_path' do + describe '#gitlab_toggle_award_emoji_snippet_path' do it 'returns the award emoji path for the personal snippet' do - expect(toggle_award_emoji_snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/toggle_award_emoji") + expect(gitlab_toggle_award_emoji_snippet_path(personal_snippet)).to eq("/snippets/#{personal_snippet.id}/toggle_award_emoji") end end - describe '#toggle_award_emoji_snippet_url' do + describe '#gitlab_toggle_award_emoji_snippet_url' do it 'returns the award url for the personal snippet' do - expect(toggle_award_emoji_snippet_url(personal_snippet)).to eq("#{Settings.gitlab['url']}/snippets/#{personal_snippet.id}/toggle_award_emoji") + expect(gitlab_toggle_award_emoji_snippet_url(personal_snippet)).to eq("http://test.host/snippets/#{personal_snippet.id}/toggle_award_emoji") end end end diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb index 1af8b7390bb..57ea5416989 100644 --- a/spec/helpers/issuables_helper_spec.rb +++ b/spec/helpers/issuables_helper_spec.rb @@ -202,6 +202,26 @@ describe IssuablesHelper do expect(helper.issuable_initial_data(issue)).to match(hash_including(expected_data)) end + describe '#sentryIssueIdentifier' do + let(:issue) { create(:issue, author: user) } + + before do + assign(:project, issue.project) + end + + it 'sets sentryIssueIdentifier to nil with no sentry issue ' do + expect(helper.issuable_initial_data(issue)[:sentryIssueIdentifier]) + .to be_nil + end + + it 'sets sentryIssueIdentifier to sentry_issue_identifier' do + sentry_issue = create(:sentry_issue, issue: issue) + + expect(helper.issuable_initial_data(issue)[:sentryIssueIdentifier]) + .to eq(sentry_issue.sentry_issue_identifier) + end + end + describe '#zoomMeetingUrl in issue' do let(:issue) { create(:issue, author: user) } diff --git a/spec/helpers/snippets_helper_spec.rb b/spec/helpers/snippets_helper_spec.rb index 2a24950502b..428fe97f172 100644 --- a/spec/helpers/snippets_helper_spec.rb +++ b/spec/helpers/snippets_helper_spec.rb @@ -14,13 +14,13 @@ describe SnippetsHelper do it 'returns view raw button of embedded snippets for personal snippets' do @snippet = create(:personal_snippet, :public) - expect(subject).to eq(download_link("#{Settings.gitlab['url']}/snippets/#{@snippet.id}/raw")) + expect(subject).to eq(download_link("http://test.host/snippets/#{@snippet.id}/raw")) end it 'returns view raw button of embedded snippets for project snippets' do @snippet = create(:project_snippet, :public) - expect(subject).to eq(download_link("#{Settings.gitlab['url']}/#{@snippet.project.path_with_namespace}/snippets/#{@snippet.id}/raw")) + expect(subject).to eq(download_link("http://test.host/#{@snippet.project.path_with_namespace}/snippets/#{@snippet.id}/raw")) end def download_link(url) @@ -34,13 +34,13 @@ describe SnippetsHelper do it 'returns download button of embedded snippets for personal snippets' do @snippet = create(:personal_snippet, :public) - expect(subject).to eq(download_link("#{Settings.gitlab['url']}/snippets/#{@snippet.id}/raw")) + expect(subject).to eq(download_link("http://test.host/snippets/#{@snippet.id}/raw")) end it 'returns download button of embedded snippets for project snippets' do @snippet = create(:project_snippet, :public) - expect(subject).to eq(download_link("#{Settings.gitlab['url']}/#{@snippet.project.path_with_namespace}/snippets/#{@snippet.id}/raw")) + expect(subject).to eq(download_link("http://test.host/#{@snippet.project.path_with_namespace}/snippets/#{@snippet.id}/raw")) end def download_link(url) @@ -56,7 +56,7 @@ describe SnippetsHelper do context 'public' do it 'returns a script tag with the snippet full url' do - expect(subject).to eq(script_embed("#{Settings.gitlab['url']}/snippets/#{snippet.id}")) + expect(subject).to eq(script_embed("http://test.host/snippets/#{snippet.id}")) end end end @@ -65,7 +65,7 @@ describe SnippetsHelper do let(:snippet) { public_project_snippet } it 'returns a script tag with the snippet full url' do - expect(subject).to eq(script_embed("#{Settings.gitlab['url']}/#{snippet.project.path_with_namespace}/snippets/#{snippet.id}")) + expect(subject).to eq(script_embed("http://test.host/#{snippet.project.path_with_namespace}/snippets/#{snippet.id}")) end end |