From f3d63eeb181db1c089bf9e4f5c0e296f6ca6230b Mon Sep 17 00:00:00 2001
From: Robert Speicher <rspeicher@gmail.com>
Date: Mon, 4 May 2015 17:46:21 -0400
Subject: [PATCH] Remove feature tests for old task lists

---
 features/project/issues/issues.feature   | 41 +++------------------
 features/project/merge_requests.feature  | 32 -----------------
 features/steps/project/issues/issues.rb  |  8 -----
 features/steps/project/merge_requests.rb |  4 ---
 features/steps/shared/markdown.rb        | 45 ------------------------
 features/steps/shared/note.rb            | 14 --------
 features/steps/shared/paths.rb           | 20 -----------
 7 files changed, 4 insertions(+), 160 deletions(-)

diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature
index eb813884d1e..bf84e2f8e87 100644
--- a/features/project/issues/issues.feature
+++ b/features/project/issues/issues.feature
@@ -134,48 +134,15 @@ Feature: Project Issues
     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
-
   @javascript
   Scenario: Issue notes should be editable with +1
-    Given project "Shop" has "Tasks-open" open issue with task markdown
-    When I visit issue page "Tasks-open"
+    Given project "Shop" have "Release 0.4" open issue
+    When I visit issue page "Release 0.4"
     And I leave a comment with a header containing "Comment with a header"
     Then The comment with the header should not have an ID
     And I edit the last comment with a +1
     Then I should see +1 in the description
 
-  # 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 the Taskable
-
-  # 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
-
   # Issue description preview
 
   @javascript
@@ -212,8 +179,8 @@ Feature: Project Issues
 
   @javascript
   Scenario: I can unsubscribe from issue
-    Given project "Shop" has "Tasks-open" open issue with task markdown
-    When I visit issue page "Tasks-open"
+    Given project "Shop" have "Release 0.4" open issue
+    When I visit issue page "Release 0.4"
     Then I should see that I am subscribed
     When I click button "Unsubscribe"
     Then I should see that I am unsubscribed
diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature
index cbb5c8eb39b..60caf783fe4 100644
--- a/features/project/merge_requests.feature
+++ b/features/project/merge_requests.feature
@@ -96,16 +96,6 @@ 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
@@ -173,28 +163,6 @@ Feature: Project Merge Requests
     And I click on the Changes tab via Javascript
     Then I should see the proper Inline and Side-by-side links
 
-  # Task status in issues list
-
-  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 the Taskable
-
-  # 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
-
   # Description preview
 
   @javascript
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
index b8e282b2029..504f0cff724 100644
--- a/features/steps/project/issues/issues.rb
+++ b/features/steps/project/issues/issues.rb
@@ -179,14 +179,6 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
            author: project.users.first)
   end
 
-  step 'project "Shop" has "Tasks-open" open issue with task markdown' do
-    create_taskable(:issue, 'Tasks-open')
-  end
-
-  step 'project "Shop" has "Tasks-closed" closed issue with task markdown' do
-    create_taskable(:closed_issue, 'Tasks-closed')
-  end
-
   step 'empty project "Empty Project"' do
     create :empty_project, name: 'Empty Project', namespace: @user.namespace
   end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 12d4d81159e..f67e6e3d8ca 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -108,10 +108,6 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
            author: project.users.first)
   end
 
-  step 'project "Shop" has "MR-task-open" open MR with task markdown' do
-    create_taskable(:merge_request, 'MR-task-open')
-  end
-
   step 'I switch to the diff tab' do
     visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
   end
diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb
index a7231c47d14..943640007a9 100644
--- a/features/steps/shared/markdown.rb
+++ b/features/steps/shared/markdown.rb
@@ -10,55 +10,10 @@ module SharedMarkdown
     find(:xpath, "#{node.path}/..").text.should == text
   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
 
-  step 'I should see task checkboxes in the description' do
-    expect(page).to have_selector(
-      'div.description li.task-list-item input[type="checkbox"]'
-    )
-  end
-
-  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)'
-    )
-  end
-
-  step 'Task checkboxes should be enabled' do
-    expect(page).to have_selector(
-      'div.description li.task-list-item input[type="checkbox"]:enabled'
-    )
-  end
-
-  step 'Task checkboxes should be disabled' do
-    expect(page).to have_selector(
-      'div.description li.task-list-item input[type="checkbox"]:disabled'
-    )
-  end
-
   step 'I should not see the Markdown preview' do
     expect(find('.gfm-form .js-md-preview')).not_to be_visible
   end
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
index 583746d4475..2f66e61b214 100644
--- a/features/steps/shared/note.rb
+++ b/features/steps/shared/note.rb
@@ -122,20 +122,6 @@ module SharedNote
     end
   end
 
-  step 'I leave a comment with task markdown' do
-    within('.js-main-target-form') do
-      fill_in 'note[note]', with: '* [x] Task item'
-      click_button 'Add Comment'
-      sleep 0.05
-    end
-  end
-
-  step 'I should not see task checkboxes in the comment' do
-    expect(page).not_to have_selector(
-      'li.note div.timeline-content input[type="checkbox"]'
-    )
-  end
-
   step 'I edit the last comment with a +1' do
     find(".note").hover
     find('.js-note-edit').click
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index e3cf1b92cda..d9401bd540c 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -323,16 +323,6 @@ module SharedPaths
     visit namespace_project_issue_path(issue.project.namespace, issue.project, issue)
   end
 
-  step 'I visit issue page "Tasks-open"' do
-    issue = Issue.find_by(title: 'Tasks-open')
-    visit namespace_project_issue_path(issue.project.namespace, issue.project, issue)
-  end
-
-  step 'I visit issue page "Tasks-closed"' do
-    issue = Issue.find_by(title: 'Tasks-closed')
-    visit namespace_project_issue_path(issue.project.namespace, issue.project, issue)
-  end
-
   step 'I visit project "Shop" labels page' do
     project = Project.find_by(name: 'Shop')
     visit namespace_project_labels_path(project.namespace, project)
@@ -363,16 +353,6 @@ module SharedPaths
     visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
   end
 
-  step 'I visit merge request page "MR-task-open"' do
-    mr = MergeRequest.find_by(title: 'MR-task-open')
-    visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
-  end
-
-  step 'I visit merge request page "MR-task-closed"' do
-    mr = MergeRequest.find_by(title: 'MR-task-closed')
-    visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr)
-  end
-
   step 'I visit project "Shop" merge requests page' do
     visit namespace_project_merge_requests_path(project.namespace, project)
   end
-- 
GitLab