summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 21:08:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 21:08:01 +0000
commit4ba55564e1dd7fdbdb89065be8eefd01d8c2d607 (patch)
tree32e6eaec4cf44b40607e3fd8c4077050c3ce9771 /spec
parent115c8ea7af7ef69ca3f09c333314546e9b5712f9 (diff)
downloadgitlab-ce-4ba55564e1dd7fdbdb89065be8eefd01d8c2d607.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/snippets/user_views_snippets_spec.rb2
-rw-r--r--spec/features/snippets/user_snippets_spec.rb6
-rw-r--r--spec/helpers/gitlab_routing_helper_spec.rb56
-rw-r--r--spec/helpers/issuables_helper_spec.rb20
-rw-r--r--spec/helpers/snippets_helper_spec.rb12
5 files changed, 58 insertions, 38 deletions
diff --git a/spec/features/projects/snippets/user_views_snippets_spec.rb b/spec/features/projects/snippets/user_views_snippets_spec.rb
index 59869244b4a..5739c9510a8 100644
--- a/spec/features/projects/snippets/user_views_snippets_spec.rb
+++ b/spec/features/projects/snippets/user_views_snippets_spec.rb
@@ -28,7 +28,7 @@ describe 'Projects > Snippets > User views snippets' do
end
it 'shows snippets' do
- expect(page).to have_content(project_snippet.title)
+ expect(page).to have_link(project_snippet.title, href: project_snippet_path(project, project_snippet))
expect(page).not_to have_content(snippet.title)
end
end
diff --git a/spec/features/snippets/user_snippets_spec.rb b/spec/features/snippets/user_snippets_spec.rb
index c6daa19d5e6..d9faea55b29 100644
--- a/spec/features/snippets/user_snippets_spec.rb
+++ b/spec/features/snippets/user_snippets_spec.rb
@@ -14,9 +14,9 @@ describe 'User Snippets' do
end
it 'View all of my snippets' do
- expect(page).to have_content(public_snippet.title)
- expect(page).to have_content(internal_snippet.title)
- expect(page).to have_content(private_snippet.title)
+ expect(page).to have_link(public_snippet.title, href: snippet_path(public_snippet))
+ expect(page).to have_link(internal_snippet.title, href: snippet_path(internal_snippet))
+ expect(page).to have_link(private_snippet.title, href: snippet_path(private_snippet))
end
it 'View my public snippets' do
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