summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAlex Sanford <alex.sanford1@gmail.com>2017-02-22 19:42:14 -0400
committerClement Ho <clemmakesapps@gmail.com>2017-02-27 20:40:49 +0000
commit42e490ea90b85cd67b99cf9afe83a31887aeb8fb (patch)
treec86f054f4606099260e88bb64fb26b10001465eb /spec
parente051ef69e3adb5d8a06a5f7fb5719c7987fe4841 (diff)
downloadgitlab-ce-42e490ea90b85cd67b99cf9afe83a31887aeb8fb.tar.gz
Fix CSS classes
Diffstat (limited to 'spec')
-rw-r--r--spec/views/projects/builds/show.html.haml_spec.rb42
1 files changed, 42 insertions, 0 deletions
diff --git a/spec/views/projects/builds/show.html.haml_spec.rb b/spec/views/projects/builds/show.html.haml_spec.rb
index b6f6e7b7a2b..ec78ac30593 100644
--- a/spec/views/projects/builds/show.html.haml_spec.rb
+++ b/spec/views/projects/builds/show.html.haml_spec.rb
@@ -209,6 +209,10 @@ describe 'projects/builds/show', :view do
it 'does not show retry button' do
expect(rendered).not_to have_link('Retry')
end
+
+ it 'does not show New issue button' do
+ expect(rendered).not_to have_link('New issue')
+ end
end
context 'when job is not running' do
@@ -220,6 +224,23 @@ describe 'projects/builds/show', :view do
it 'shows retry button' do
expect(rendered).to have_link('Retry')
end
+
+ context 'if build passed' do
+ it 'does not show New issue button' do
+ expect(rendered).not_to have_link('New issue')
+ end
+ end
+
+ context 'if build failed' do
+ before do
+ build.status = 'failed'
+ render
+ end
+
+ it 'shows New issue button' do
+ expect(rendered).to have_link('New issue')
+ end
+ end
end
describe 'commit title in sidebar' do
@@ -248,4 +269,25 @@ describe 'projects/builds/show', :view do
expect(rendered).to have_css('.js-build-value', visible: false, text: 'TRIGGER_VALUE_2')
end
end
+
+ describe 'New issue button' do
+ before do
+ build.status = 'failed'
+ render
+ end
+
+ it 'links to issues/new with the title and description filled in' do
+ title = "Build Failed ##{build.id}"
+ build_url = namespace_project_build_url(project.namespace, project, build)
+ href = new_namespace_project_issue_path(
+ project.namespace,
+ project,
+ issue: {
+ title: title,
+ description: build_url
+ }
+ )
+ expect(rendered).to have_link('New issue', href: href)
+ end
+ end
end