summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-07 12:56:18 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-01-07 12:56:18 +0100
commit41b8a238ce4bd7f091d46fb9b89b7456fde17ddf (patch)
tree5f3ab03e9d8aec93cb53df744e9a9e19fc6a9d6f /features
parentda912c8f4ce6a8e828bc0ef4dd352fd54df0739f (diff)
downloadgitlab-ce-41b8a238ce4bd7f091d46fb9b89b7456fde17ddf.tar.gz
Merge branch 'master' of github.com:gitlabhq/gitlabhq
Diffstat (limited to 'features')
-rw-r--r--features/project/find_file.feature42
-rw-r--r--features/steps/project/project_find_file.rb73
-rw-r--r--features/steps/shared/paths.rb4
3 files changed, 119 insertions, 0 deletions
diff --git a/features/project/find_file.feature b/features/project/find_file.feature
new file mode 100644
index 00000000000..ae8fa245923
--- /dev/null
+++ b/features/project/find_file.feature
@@ -0,0 +1,42 @@
+@dashboard
+Feature: Project Find File
+ Background:
+ Given I sign in as a user
+ And I own a project
+ And I visit my project's files page
+
+ @javascript
+ Scenario: Navigate to find file by shortcut
+ Given I press "t"
+ Then I should see "find file" page
+
+ Scenario: Navigate to find file
+ Given I click Find File button
+ Then I should see "find file" page
+
+ @javascript
+ Scenario: I search file
+ Given I visit project find file page
+ And I fill in file find with "change"
+ Then I should not see ".gitignore" in files
+ And I should not see ".gitmodules" in files
+ And I should see "CHANGELOG" in files
+ And I should not see "VERSION" in files
+
+ @javascript
+ Scenario: I search file that not exist
+ Given I visit project find file page
+ And I fill in file find with "asdfghjklqwertyuizxcvbnm"
+ Then I should not see ".gitignore" in files
+ And I should not see ".gitmodules" in files
+ And I should not see "CHANGELOG" in files
+ And I should not see "VERSION" in files
+
+ @javascript
+ Scenario: I search file that partially matches
+ Given I visit project find file page
+ And I fill in file find with "git"
+ Then I should see ".gitignore" in files
+ And I should see ".gitmodules" in files
+ And I should not see "CHANGELOG" in files
+ And I should not see "VERSION" in files
diff --git a/features/steps/project/project_find_file.rb b/features/steps/project/project_find_file.rb
new file mode 100644
index 00000000000..8c1d09d6cc6
--- /dev/null
+++ b/features/steps/project/project_find_file.rb
@@ -0,0 +1,73 @@
+class Spinach::Features::ProjectFindFile < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedProjectTab
+
+ step 'I press "t"' do
+ find('body').native.send_key('t')
+ end
+
+ step 'I click Find File button' do
+ click_link 'Find File'
+ end
+
+ step 'I should see "find file" page' do
+ ensure_active_main_tab('Files')
+ expect(page).to have_selector('.file-finder-holder', count: 1)
+ end
+
+ step 'I fill in Find by path with "git"' do
+ ensure_active_main_tab('Files')
+ expect(page).to have_selector('.file-finder-holder', count: 1)
+ end
+
+ step 'I fill in file find with "git"' do
+ find_file "git"
+ end
+
+ step 'I fill in file find with "change"' do
+ find_file "change"
+ end
+
+ step 'I fill in file find with "asdfghjklqwertyuizxcvbnm"' do
+ find_file "asdfghjklqwertyuizxcvbnm"
+ end
+
+ step 'I should see "VERSION" in files' do
+ expect(page).to have_content("VERSION")
+ end
+
+ step 'I should not see "VERSION" in files' do
+ expect(page).not_to have_content("VERSION")
+ end
+
+ step 'I should see "CHANGELOG" in files' do
+ expect(page).to have_content("CHANGELOG")
+ end
+
+ step 'I should not see "CHANGELOG" in files' do
+ expect(page).not_to have_content("CHANGELOG")
+ end
+
+ step 'I should see ".gitmodules" in files' do
+ expect(page).to have_content(".gitmodules")
+ end
+
+ step 'I should not see ".gitmodules" in files' do
+ expect(page).not_to have_content(".gitmodules")
+ end
+
+ step 'I should see ".gitignore" in files' do
+ expect(page).to have_content(".gitignore")
+ end
+
+ step 'I should not see ".gitignore" in files' do
+ expect(page).not_to have_content(".gitignore")
+ end
+
+
+ def find_file(text)
+ fill_in 'file_find', with: text
+ end
+end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index b33bd332655..4264c9c6f1a 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -259,6 +259,10 @@ module SharedPaths
visit namespace_project_deploy_keys_path(@project.namespace, @project)
end
+ step 'I visit project find file page' do
+ visit namespace_project_find_file_path(@project.namespace, @project, root_ref)
+ end
+
# ----------------------------------------
# "Shop" Project
# ----------------------------------------