summaryrefslogtreecommitdiff
path: root/features/steps/shared/markdown.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/shared/markdown.rb')
-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)'
)