Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinnie Okada <vokada@mrvinn.com>2014-10-07 04:19:12 +0400
committerVinnie Okada <vokada@mrvinn.com>2014-10-07 04:19:12 +0400
commit40263a06c196e0c99cc13d187228bd62bbcf4a6a (patch)
tree37bce0ef915874dfe215ba78e2fe4964b879571e /features/steps/shared
parent31bc42de57b3cfd7bf068df06d15372307b8661b (diff)
Refactor task list tests and coffeescript
Diffstat (limited to 'features/steps/shared')
-rw-r--r--features/steps/shared/markdown.rb29
1 files changed, 22 insertions, 7 deletions
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
index 1d9058cf256..8bf138065b0 100644
--- a/features/steps/shared/markdown.rb
+++ b/features/steps/shared/markdown.rb
@@ -6,6 +6,27 @@ module SharedMarkdown
find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/
end
+ def create_taskable(type, title)
+ desc_text = <<EOT.gsub(/^ {6}/, '')
+ * [ ] Task 1
+ * [x] Task 2
+EOT
+
+ case type
+ when :issue, :closed_issue
+ options = { project: project }
+ when :merge_request
+ options = { source_project: project, target_project: project }
+ end
+
+ create(
+ type,
+ options.merge(title: title,
+ author: project.users.first,
+ description: desc_text)
+ )
+ end
+
step 'Header "Description header" should have correct id and link' do
header_should_have_correct_id_and_link(1, 'Description header', 'description-header')
end
@@ -16,13 +37,7 @@ module SharedMarkdown
)
end
- step 'I should see the task status for issue "Tasks-open"' do
- expect(find(:css, 'span.task-status').text).to eq(
- '2 tasks (1 done, 1 unfinished)'
- )
- end
-
- step 'I should see the task status for merge request "MR-task-open"' do
+ step 'I should see the task status for the Taskable' do
expect(find(:css, 'span.task-status').text).to eq(
'2 tasks (1 done, 1 unfinished)'
)