From 31bc42de57b3cfd7bf068df06d15372307b8661b Mon Sep 17 00:00:00 2001 From: Vinnie Okada Date: Mon, 6 Oct 2014 01:59:03 -0500 Subject: [PATCH] Add Spinach tests for task lists --- features/project/issues/issues.feature | 33 ++++++++++++++++++++++++ features/project/merge_requests.feature | 33 ++++++++++++++++++++++++ features/steps/project/issues/issues.rb | 26 +++++++++++++++++++ features/steps/project/merge_requests.rb | 14 ++++++++++ features/steps/shared/markdown.rb | 30 +++++++++++++++++++++ features/steps/shared/note.rb | 14 ++++++++++ features/steps/shared/paths.rb | 20 ++++++++++++++ 7 files changed, 170 insertions(+) diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index ae6a03ce865..e989569ccd4 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -126,3 +126,36 @@ Feature: Project Issues When I click label 'bug' And I should see "Release 0.4" in issues And I should not see "Tweet control" in issues + + Scenario: Issue description should render task checkboxes + Given project "Shop" has "Tasks-open" open issue with task markdown + When I visit issue page "Tasks-open" + Then I should see task checkboxes in the description + + @javascript + Scenario: Issue notes should not render task checkboxes + Given project "Shop" has "Tasks-open" open issue with task markdown + When I visit issue page "Tasks-open" + And I leave a comment with task markdown + Then I should not see task checkboxes in the comment + + # Task status in issues list + + Scenario: Issues list should display task status + Given project "Shop" has "Tasks-open" open issue with task markdown + When I visit project "Shop" issues page + Then I should see the task status for issue "Tasks-open" + + # Toggling task items + + @javascript + Scenario: Task checkboxes should be enabled for an open issue + Given project "Shop" has "Tasks-open" open issue with task markdown + When I visit issue page "Tasks-open" + Then Task checkboxes should be enabled + + @javascript + Scenario: Task checkboxes should be disabled for a closed issue + Given project "Shop" has "Tasks-closed" closed issue with task markdown + When I visit issue page "Tasks-closed" + Then Task checkboxes should be disabled diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature index f8dccc15c0e..bad83191371 100644 --- a/features/project/merge_requests.feature +++ b/features/project/merge_requests.feature @@ -96,6 +96,16 @@ Feature: Project Merge Requests And I leave a comment with a header containing "Comment with a header" Then The comment with the header should not have an ID + Scenario: Merge request description should render task checkboxes + Given project "Shop" has "MR-task-open" open MR with task markdown + When I visit merge request page "MR-task-open" + Then I should see task checkboxes in the description + + Scenario: Merge request notes should not render task checkboxes + Given project "Shop" has "MR-task-open" open MR with task markdown + When I visit merge request page "MR-task-open" + Then I should not see task checkboxes in the comment + # Toggling inline comments @javascript @@ -157,3 +167,26 @@ Feature: Project Merge Requests And I leave a comment like "Line is wrong" on line 39 of the second file And I click Side-by-side Diff tab Then I should see comments on the side-by-side diff page + + # Task status in issues list + + @now + Scenario: Merge requests list should display task status + Given project "Shop" has "MR-task-open" open MR with task markdown + When I visit project "Shop" merge requests page + Then I should see the task status for merge request "MR-task-open" + + # Toggling task items + + @javascript + Scenario: Task checkboxes should be enabled for an open merge request + Given project "Shop" has "MR-task-open" open MR with task markdown + When I visit merge request page "MR-task-open" + Then Task checkboxes should be enabled + + @javascript + Scenario: Task checkboxes should be disabled for a closed merge request + Given project "Shop" has "MR-task-open" open MR with task markdown + And I visit merge request page "MR-task-open" + And I click link "Close" + Then Task checkboxes should be disabled diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index b55b3c6c8a2..26c3c7c14bc 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -153,6 +153,32 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps author: project.users.first) end + step 'project "Shop" has "Tasks-open" open issue with task markdown' do + desc_text = <