From e6e4147880e831cdc6cc9ef31774297222f654c3 Mon Sep 17 00:00:00 2001
From: Lisanne Fellinger <lisanne.88@gmail.com>
Date: Thu, 27 Oct 2016 22:08:20 +0200
Subject: [PATCH] Rewritten spinach git_blame tests to rspec feature tests

Fixing rubocop violations

Relocated git_blame spec and fixed styling issue

Rewritten spinach git_blame tests to rspec feature tests

Fixing rubocop violations

Relocated git_blame spec and fixed styling issue

Rewritten spinach git_blame tests to rspec feature tests

Fixing rubocop violations

Rewritten spinach git_blame tests to rspec feature tests

Fixing rubocop violations

Rewritten spinach git_blame tests to rspec feature tests

Fixing rubocop violations

Relocated git_blame spec and fixed styling issue
---
 ...spinach-tests-with-rspec-feature-tests.yml |  4 ++++
 features/project/source/git_blame.feature     | 10 ---------
 features/steps/project/source/git_blame.rb    | 19 -----------------
 .../projects/files/browse_files_spec.rb       | 21 +++++++++++++++++++
 4 files changed, 25 insertions(+), 29 deletions(-)
 create mode 100644 changelogs/unreleased/23036-replace-git-blame-spinach-tests-with-rspec-feature-tests.yml
 delete mode 100644 features/project/source/git_blame.feature
 delete mode 100644 features/steps/project/source/git_blame.rb
 create mode 100644 spec/features/projects/files/browse_files_spec.rb

diff --git a/changelogs/unreleased/23036-replace-git-blame-spinach-tests-with-rspec-feature-tests.yml b/changelogs/unreleased/23036-replace-git-blame-spinach-tests-with-rspec-feature-tests.yml
new file mode 100644
index 00000000000..7b54d3df56d
--- /dev/null
+++ b/changelogs/unreleased/23036-replace-git-blame-spinach-tests-with-rspec-feature-tests.yml
@@ -0,0 +1,4 @@
+---
+title: Rewrite git blame spinach feature tests to rspec feature tests
+merge_request: 7197
+author: Lisanne Fellinger
diff --git a/features/project/source/git_blame.feature b/features/project/source/git_blame.feature
deleted file mode 100644
index 48b1077dc6b..00000000000
--- a/features/project/source/git_blame.feature
+++ /dev/null
@@ -1,10 +0,0 @@
-Feature: Project Source Git Blame
-  Background:
-    Given I sign in as a user
-    And I own project "Shop"
-    Given I visit project source page
-
-  Scenario: I blame file
-    Given I click on ".gitignore" file in repo
-    And I click Blame button
-    Then I should see git file blame
diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb
deleted file mode 100644
index d0a27f47e2a..00000000000
--- a/features/steps/project/source/git_blame.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps
-  include SharedAuthentication
-  include SharedProject
-  include SharedPaths
-
-  step 'I click on ".gitignore" file in repo' do
-    click_link ".gitignore"
-  end
-
-  step 'I click Blame button' do
-    click_link 'Blame'
-  end
-
-  step 'I should see git file blame' do
-    expect(page).to have_content "*.rb"
-    expect(page).to have_content "Dmitriy Zaporozhets"
-    expect(page).to have_content "Initial commit"
-  end
-end
diff --git a/spec/features/projects/files/browse_files_spec.rb b/spec/features/projects/files/browse_files_spec.rb
new file mode 100644
index 00000000000..69295e450d0
--- /dev/null
+++ b/spec/features/projects/files/browse_files_spec.rb
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+feature 'user checks git blame', feature: true do
+  let(:project) { create(:project) }
+  let(:user) { create(:user) }
+
+  before do
+    project.team << [user, :master]
+    login_with(user)
+    visit namespace_project_tree_path(project.namespace, project, project.default_branch)
+  end
+
+  scenario "can see blame of '.gitignore'" do
+    click_link ".gitignore"
+    click_link 'Blame'
+    
+    expect(page).to have_content "*.rb"
+    expect(page).to have_content "Dmitriy Zaporozhets"
+    expect(page).to have_content "Initial commit"
+  end
+end
-- 
GitLab