summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2016-12-22 13:27:39 +0000
committerNick Thomas <nick@gitlab.com>2016-12-22 13:57:00 +0000
commit22bbb24f28718849934693b8163155ccae4c4b5e (patch)
treeeb954e0a9629058bc12f84d9b24084ac30648425 /spec
parent6e2a6fd09167947a3bd8e1a4cda96dbfae395b3a (diff)
downloadgitlab-ce-22bbb24f28718849934693b8163155ccae4c4b5e.tar.gz
Fix viewing "build failed" TODOs
Diffstat (limited to 'spec')
-rw-r--r--spec/factories/todos.rb1
-rw-r--r--spec/features/todos/todos_spec.rb19
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/factories/todos.rb b/spec/factories/todos.rb
index 866e663f026..082b02116c0 100644
--- a/spec/factories/todos.rb
+++ b/spec/factories/todos.rb
@@ -21,6 +21,7 @@ FactoryGirl.define do
trait :build_failed do
action { Todo::BUILD_FAILED }
+ target factory: :merge_request
end
trait :approval_required do
diff --git a/spec/features/todos/todos_spec.rb b/spec/features/todos/todos_spec.rb
index 88eabea7e3a..4bda0927692 100644
--- a/spec/features/todos/todos_spec.rb
+++ b/spec/features/todos/todos_spec.rb
@@ -155,5 +155,24 @@ describe 'Dashboard Todos', feature: true do
expect(page).to have_selector('.todos-all-done', count: 1)
end
end
+
+ context 'User has a Build Failed todo' do
+ let!(:todo) { create(:todo, :build_failed, user: user, project: project, author: author) }
+
+ before do
+ login_as user
+ visit dashboard_todos_path
+ end
+
+ it 'shows the todo' do
+ expect(page).to have_content 'The build failed for your merge request'
+ end
+
+ it 'links to the pipelines for the merge request' do
+ href = pipelines_namespace_project_merge_request_path(project.namespace, project, todo.target)
+
+ expect(page).to have_link "merge request #{todo.target.to_reference}", href
+ end
+ end
end
end