OSDN Git Service

Merge pull request #1426 from NARKOZ/spinach
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 10 Sep 2012 16:09:07 +0000 (09:09 -0700)
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Mon, 10 Sep 2012 16:09:07 +0000 (09:09 -0700)
Cucumber => Spinach

76 files changed:
Gemfile
Gemfile.lock
Guardfile
config/cucumber.yml [deleted file]
features/dashboard/dashboard.feature
features/dashboard/issues.feature
features/dashboard/merge_requests.feature
features/dashboard/search.feature
features/profile/profile.feature
features/profile/ssh_keys.feature
features/project/commits/branches.feature [moved from features/projects/commits/branches.feature with 66% similarity]
features/project/commits/commit_comments.feature [moved from features/projects/commits/commit_comments.feature with 72% similarity]
features/project/commits/commits.feature [moved from features/projects/commits/commits.feature with 82% similarity]
features/project/commits/tags.feature [moved from features/projects/commits/tags.feature with 53% similarity]
features/project/create_project.feature [moved from features/projects/create_project.feature with 91% similarity]
features/project/issues/issues.feature [moved from features/projects/issues/issues.feature with 97% similarity]
features/project/issues/labels.feature [new file with mode: 0644]
features/project/issues/milestones.feature [moved from features/projects/issues/milestones.feature with 79% similarity]
features/project/merge_requests.feature [moved from features/projects/merge_requests.feature with 92% similarity]
features/project/network.feature [moved from features/projects/network.feature with 81% similarity]
features/project/project.feature [new file with mode: 0644]
features/project/source/browse_files.feature [moved from features/projects/source/browse_files.feature with 71% similarity]
features/project/source/git_blame.feature [new file with mode: 0644]
features/project/team_management.feature [moved from features/projects/team_management.feature with 78% similarity]
features/project/wall.feature [moved from features/projects/wall.feature with 63% similarity]
features/project/wiki.feature [moved from features/projects/wiki.feature with 83% similarity]
features/projects/deploy_keys.feature [deleted file]
features/projects/issues/labels.feature [deleted file]
features/projects/project.feature [deleted file]
features/projects/snippets.feature [deleted file]
features/projects/source/git_blame.feature [deleted file]
features/projects/web_hooks.feature [deleted file]
features/step_definitions/common_steps.rb [deleted file]
features/step_definitions/dashboard_steps.rb [deleted file]
features/step_definitions/profile/profile_keys_steps.rb [deleted file]
features/step_definitions/profile/profile_steps.rb [deleted file]
features/step_definitions/project/browse_code_steps.rb [deleted file]
features/step_definitions/project/project_commits_steps.rb [deleted file]
features/step_definitions/project/project_issues_steps.rb [deleted file]
features/step_definitions/project/project_merge_requests_steps.rb [deleted file]
features/step_definitions/project/project_milestones_steps.rb [deleted file]
features/step_definitions/project/project_team_steps.rb [deleted file]
features/step_definitions/project/project_wiki_steps.rb [deleted file]
features/step_definitions/project/projects_steps.rb [deleted file]
features/step_definitions/visit_steps.rb [deleted file]
features/steps/dashboard/dashboard.rb [new file with mode: 0644]
features/steps/dashboard/dashboard_issues.rb [new file with mode: 0644]
features/steps/dashboard/dashboard_merge_requests.rb [new file with mode: 0644]
features/steps/dashboard/dashboard_search.rb [new file with mode: 0644]
features/steps/profile/profile.rb [new file with mode: 0644]
features/steps/profile/profile_ssh_keys.rb [new file with mode: 0644]
features/steps/project/create_project.rb [new file with mode: 0644]
features/steps/project/project.rb [new file with mode: 0644]
features/steps/project/project_browse_branches.rb [new file with mode: 0644]
features/steps/project/project_browse_commits.rb [new file with mode: 0644]
features/steps/project/project_browse_files.rb [new file with mode: 0644]
features/steps/project/project_browse_git_repo.rb [new file with mode: 0644]
features/steps/project/project_browse_tags.rb [new file with mode: 0644]
features/steps/project/project_comment_commit.rb [new file with mode: 0644]
features/steps/project/project_issues.rb [new file with mode: 0644]
features/steps/project/project_labels.rb [new file with mode: 0644]
features/steps/project/project_merge_requests.rb [new file with mode: 0644]
features/steps/project/project_milestones.rb [new file with mode: 0644]
features/steps/project/project_network_graph.rb [new file with mode: 0644]
features/steps/project/project_team_management.rb [new file with mode: 0644]
features/steps/project/project_wall.rb [new file with mode: 0644]
features/steps/project/project_wiki.rb [new file with mode: 0644]
features/steps/shared/authentication.rb [new file with mode: 0644]
features/steps/shared/note.rb [new file with mode: 0644]
features/steps/shared/paths.rb [new file with mode: 0644]
features/steps/shared/project.rb [new file with mode: 0644]
features/support/env.rb
lib/tasks/cucumber.rake [deleted file]
lib/tasks/gitlab/test.rake
lib/tasks/travis.rake
script/cucumber [deleted file]

diff --git a/Gemfile b/Gemfile
index 6205594..0a5f730 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -106,6 +106,7 @@ group :development do
 end
 
 group :development, :test do
+  gem 'spinach-rails'
   gem "rspec-rails"
   gem "capybara"
   gem "capybara-webkit"
@@ -118,7 +119,7 @@ group :development, :test do
 
   # Guard
   gem 'guard-rspec'
-  gem 'guard-cucumber'
+  gem 'guard-spinach'
 
   # Notification
   gem 'rb-fsevent', :require => darwin_only('rb-fsevent')
@@ -127,7 +128,6 @@ group :development, :test do
 end
 
 group :test do
-  gem 'cucumber-rails', :require => false
   gem "simplecov", :require => false
   gem "shoulda-matchers"
   gem 'email_spec'
index 94b1628..8046b92 100644 (file)
@@ -132,16 +132,8 @@ GEM
       execjs
     coffee-script-source (1.3.3)
     colored (1.2)
+    colorize (0.5.8)
     crack (0.3.1)
-    cucumber (1.2.1)
-      builder (>= 2.1.2)
-      diff-lcs (>= 1.1.3)
-      gherkin (~> 2.11.0)
-      json (>= 1.4.6)
-    cucumber-rails (1.3.0)
-      capybara (>= 1.1.2)
-      cucumber (>= 1.1.8)
-      nokogiri (>= 1.5.0)
     daemons (1.1.8)
     database_cleaner (0.8.0)
     devise (2.1.2)
@@ -170,8 +162,7 @@ GEM
     ffi (1.0.11)
     foreman (0.47.0)
       thor (>= 0.13.6)
-    gherkin (2.11.0)
-      json (>= 1.4.6)
+    gherkin-ruby (0.2.1)
     git (1.2.5)
     github-markup (0.7.4)
     gitlab_meta (2.9)
@@ -185,11 +176,11 @@ GEM
     guard (1.3.2)
       listen (>= 0.4.2)
       thor (>= 0.14.6)
-    guard-cucumber (1.2.0)
-      cucumber (>= 1.2.0)
-      guard (>= 1.1.0)
     guard-rspec (1.2.1)
       guard (>= 1.1)
+    guard-spinach (0.0.2)
+      guard (>= 1.1)
+      spinach
     haml (3.1.6)
     haml-rails (0.3.4)
       actionpack (~> 3.0)
@@ -344,6 +335,13 @@ GEM
       tilt (~> 1.3, >= 1.3.3)
     six (0.2.0)
     slop (2.4.4)
+    spinach (0.5.2)
+      colorize
+      gherkin-ruby (~> 0.2.0)
+    spinach-rails (0.1.8)
+      capybara (~> 1)
+      railties (>= 3)
+      spinach (>= 0.4)
     sprockets (2.1.3)
       hike (~> 1.2)
       rack (~> 1.0)
@@ -394,7 +392,6 @@ DEPENDENCIES
   chosen-rails
   coffee-rails (= 3.2.2)
   colored
-  cucumber-rails
   database_cleaner
   devise (~> 2.1.0)
   draper
@@ -410,8 +407,8 @@ DEPENDENCIES
   grape (~> 0.2.1)
   grit!
   growl
-  guard-cucumber
   guard-rspec
+  guard-spinach
   haml-rails
   headless
   httparty
@@ -442,6 +439,7 @@ DEPENDENCIES
   shoulda-matchers
   simplecov
   six
+  spinach-rails
   sqlite3
   stamp
   therubyracer
index ed38f54..6ed414b 100644 (file)
--- a/Guardfile
+++ b/Guardfile
@@ -13,18 +13,14 @@ guard 'rspec', :version => 2 do
   watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
   watch('config/routes.rb')                           { "spec/routing" }
   watch('app/controllers/application_controller.rb')  { "spec/controllers" }
-  
+
   # Capybara request specs
   watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
-  
-  # Turnip features and steps
-  watch(%r{^spec/acceptance/(.+)\.feature$})
-  watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$})   { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
 end
 
-
-guard 'cucumber' do
-  watch(%r{^features/.+\.feature$})
-  watch(%r{^features/support/.+$})          { 'features' }
-  watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
+guard 'spinach' do
+  watch(%r|^features/(.*)\.feature|)
+  watch(%r|^features/steps/(.*)([^/]+)\.rb|) do |m|
+    "features/#{m[1]}#{m[2]}.feature"
+  end
 end
diff --git a/config/cucumber.yml b/config/cucumber.yml
deleted file mode 100644 (file)
index 19b288d..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<%
-rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
-rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
-std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
-%>
-default: <%= std_opts %> features
-wip: --tags @wip:3 --wip features
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
index 98bb498..9756bc7 100644 (file)
@@ -1,9 +1,9 @@
 Feature: Dashboard
-  Background: 
-    Given I signin as a user
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     And project "Shop" has push event
-    And I visit dashboard page 
+    And I visit dashboard page
 
   Scenario: I should see projects list
     Then I should see "New Project" link
@@ -25,4 +25,3 @@ Feature: Dashboard
     And user with name "John Doe" left project "Shop"
     When I visit dashboard page
     Then I should see "John Doe left project Shop" event
-  
index c3361bb..895b89a 100644 (file)
@@ -1,8 +1,8 @@
 Feature: Dashboard Issues
-  Background: 
-    Given I signin as a user
+  Background:
+    Given I sign in as a user
     And I have assigned issues
-    And I visit dashboard issues page 
+    And I visit dashboard issues page
 
   Scenario: I should see issues list
     Then I should see issues assigned to me
index 90b8749..cad65b0 100644 (file)
@@ -1,8 +1,8 @@
-Feature: Dashboard MR
-  Background: 
-    Given I signin as a user
+Feature: Dashboard Merge Requests
+  Background:
+    Given I sign in as a user
     And I have authored merge requests
-    And I visit dashboard merge requests page 
+    And I visit dashboard merge requests page
 
   Scenario: I should see projects list
     Then I should see my merge requests
index f053fe8..91d870f 100644 (file)
@@ -1,11 +1,9 @@
 Feature: Dashboard Search
-  Background: 
-    Given I signin as a user
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
-    And I visit dashboard search page 
+    And I visit dashboard search page
 
-  Scenario: I should see project i'm looking for
+  Scenario: I should see project I am looking for
     Given I search for "Sho"
     Then I should see "Shop" project link
-
-
index afda4b5..f4b2f19 100644 (file)
@@ -1,6 +1,6 @@
 Feature: Profile
-  Background: 
-    Given I signin as a user
+  Background:
+    Given I sign in as a user
 
   Scenario: I look at my profile
     Given I visit profile page
index c81503e..018d124 100644 (file)
@@ -1,13 +1,10 @@
-Feature: SSH Keys
-  Background: 
-    Given I signin as a user
-    And I have ssh keys:
-      | title | 
-      | ssh-rsa Work |
-      | ssh-rsa Home |
+Feature: Profile SSH Keys
+  Background:
+    Given I sign in as a user
+    And I have ssh key "ssh-rsa Work"
     And I visit profile keys page
 
-  Scenario: I should see SSH keys
+  Scenario: I should see ssh keys
     Then I should see my ssh keys
 
   Scenario: Add new ssh key
similarity index 66%
rename from features/projects/commits/branches.feature
rename to features/project/commits/branches.feature
index 74575c5..4fa4dc2 100644 (file)
@@ -1,6 +1,6 @@
-Feature: Browse branches
-  Background: 
-    Given I signin as a user
+Feature: Project Browse branches
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     And project "Shop" has protected branches
     Given I visit project branches page
@@ -16,8 +16,11 @@ Feature: Browse branches
     Given I click link "Protected"
     Then I should see "Shop" protected branches list
 
-  Scenario: I can download project by branch
+  # @wip
+  # Scenario: I can download project by branch
 
-  Scenario: I can view protected branches
+  # @wip
+  # Scenario: I can view protected branches
 
-  Scenario: I can manage protected branches
+  # @wip
+  # Scenario: I can manage protected branches
@@ -1,6 +1,6 @@
-Feature: Comment commit
-  Background: 
-    Given I signin as a user
+Feature: Project Comment commit
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     Given I visit project commit page
 
similarity index 82%
rename from features/projects/commits/commits.feature
rename to features/project/commits/commits.feature
index 69d39d7..53de6e6 100644 (file)
@@ -1,6 +1,6 @@
-Feature: Browse commits
-  Background: 
-    Given I signin as a user
+Feature: Project Browse commits
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     Given I visit project commits page
 
@@ -18,5 +18,4 @@ Feature: Browse commits
   Scenario: I compare refs
     Given I visit compare refs page
     And I fill compare fields with refs
-    And I see compared refs 
-
+    And I see compared refs
similarity index 53%
rename from features/projects/commits/tags.feature
rename to features/project/commits/tags.feature
index f7899fc..1ac0f8b 100644 (file)
@@ -1,10 +1,11 @@
-Feature: Browse tags
-  Background: 
-    Given I signin as a user
+Feature: Project Browse tags
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     Given I visit project tags page
 
   Scenario: I can see all git tags
     Then I should see "Shop" all tags list
 
-  Scenario: I can download project by tag
+  # @wip
+  # Scenario: I can download project by tag
similarity index 91%
rename from features/projects/create_project.feature
rename to features/project/create_project.feature
index 42d25b3..b7cdfdb 100644 (file)
@@ -4,7 +4,7 @@ Feature: Create Project
   Should be able to create a new one
 
   Scenario: User create a project
-    Given I signin as a user
+    Given I sign in as a user
     When I visit new project page
     And fill project form with valid data
     Then I should see project page
similarity index 97%
rename from features/projects/issues/issues.feature
rename to features/project/issues/issues.feature
index b2301b3..596e8bd 100644 (file)
@@ -1,6 +1,6 @@
-Feature: Issues
+Feature: Project Issues
   Background:
-    Given I signin as a user
+    Given I sign in as a user
     And I own project "Shop"
     And project "Shop" have "Release 0.4" open issue
     And project "Shop" have "Release 0.3" closed issue
@@ -79,4 +79,3 @@ Feature: Issues
     When I select first assignee from "Shop" project
     And I click link "New Issue"
     Then I should see first assignee from "Shop" as selected assignee
-
diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature
new file mode 100644 (file)
index 0000000..e601a41
--- /dev/null
@@ -0,0 +1,10 @@
+Feature: Project Labels
+  Background:
+    Given I sign in as a user
+    And I own project "Shop"
+    And project "Shop" have issues tags: "bug", "feature"
+    Given I visit project "Shop" labels page
+
+  Scenario: I should see active milestones
+    Then I should see label "bug"
+    And I should see label "feature"
similarity index 79%
rename from features/projects/issues/milestones.feature
rename to features/project/issues/milestones.feature
index d78096a..a57f67d 100644 (file)
@@ -1,9 +1,9 @@
-Feature: Milestones
+Feature: Project Milestones
   Background:
-    Given I signin as a user
+    Given I sign in as a user
     And I own project "Shop"
     And project "Shop" has milestone "v2.2"
-    Given I visit project "Shop" milestones page 
+    Given I visit project "Shop" milestones page
 
   Scenario: I should see active milestones
     Then I should see milestone "v2.2"
similarity index 92%
rename from features/projects/merge_requests.feature
rename to features/project/merge_requests.feature
index 54b6ccd..80f0098 100644 (file)
@@ -1,10 +1,10 @@
-Feature: Merge Requests
+Feature: Project Merge Requests
   Background:
-    Given I signin as a user
+    Given I sign in as a user
     And I own project "Shop"
     And project "Shop" have "Bug NS-04" open merge request
     And project "Shop" have "Feature NS-03" closed merge request
-    And I visit project "Shop" merge requests page 
+    And I visit project "Shop" merge requests page
 
   Scenario: I should see open merge requests
     Then I should see "Bug NS-04" in merge requests
similarity index 81%
rename from features/projects/network.feature
rename to features/project/network.feature
index 61c05eb..31ce5ad 100644 (file)
@@ -1,10 +1,9 @@
-@javascript
 Feature: Project Network Graph
-
   Background:
-    Given I signin as a user
+    Given I sign in as a user
     And I own project "Shop"
     And I visit project "Shop" network page
 
+  @javascript
   Scenario: I should see project network
     Then page should have network graph
diff --git a/features/project/project.feature b/features/project/project.feature
new file mode 100644 (file)
index 0000000..1c9f201
--- /dev/null
@@ -0,0 +1,14 @@
+Feature: Projects
+  Background:
+    Given I signin as a user
+    And I own project "Shop"
+    And I visit project "Shop" page
+
+  # @wip
+  # Scenario: I should see project activity
+
+  # @wip
+  # Scenario: I edit project
+
+  # @wip
+  # Scenario: I visit attachments
similarity index 71%
rename from features/projects/source/browse_files.feature
rename to features/project/source/browse_files.feature
index 04aebc1..b12b0ee 100644 (file)
@@ -1,6 +1,6 @@
-Feature: Browse git repo
-  Background: 
-    Given I signin as a user
+Feature: Project Browse files
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     Given I visit project source page
 
@@ -12,12 +12,10 @@ Feature: Browse git repo
     Then I should see files from repository for "8470d70"
 
   Scenario: I browse file content
-    Given I click on file from repo
+    Given I click on "Gemfile" file in repo
     Then I should see it content
 
   Scenario: I browse raw file
-    Given I visit blob file from repo 
-    And I click on raw button
+    Given I visit blob file from repo
+    And I click link "raw"
     Then I should see raw file content
-
-
diff --git a/features/project/source/git_blame.feature b/features/project/source/git_blame.feature
new file mode 100644 (file)
index 0000000..93ed20a
--- /dev/null
@@ -0,0 +1,10 @@
+Feature: Project Browse git repo
+  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 "Gemfile" file in repo
+    And I click blame button
+    Then I should see git file blame
similarity index 78%
rename from features/projects/team_management.feature
rename to features/project/team_management.feature
index b5b485e..ae0c459 100644 (file)
@@ -1,11 +1,11 @@
 Feature: Project Team management
-  Background: 
-    Given I signin as a user
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
-    And gitlab user "Mike" 
-    And gitlab user "Sam" 
+    And gitlab user "Mike"
+    And gitlab user "Sam"
     And "Sam" is "Shop" developer
-    And I visit project "Shop" team page 
+    And I visit project "Shop" team page
 
   Scenario: See all team members
     Then I should be able to see myself in team
@@ -20,7 +20,7 @@ Feature: Project Team management
   Scenario: Update user access
     Given I should see "Sam" in team list as "Developer"
     And I change "Sam" role to "Reporter"
-    Then I visit project "Shop" team page 
+    Then I visit project "Shop" team page
     And I should see "Sam" in team list as "Reporter"
 
   Scenario: View team member profile
@@ -30,6 +30,5 @@ Feature: Project Team management
   Scenario: Cancel team member
     Given I click link "Sam"
     And I click link "Remove from team"
-    Then I visit project "Shop" team page 
+    Then I visit project "Shop" team page
     And I should not see "Sam" in team list
-
similarity index 63%
rename from features/projects/wall.feature
rename to features/project/wall.feature
index ed675e2..c38d046 100644 (file)
@@ -1,17 +1,16 @@
-@javascript
 Feature: Project Wall
   In order to use Project Wall
-  A user
-  Should be able to read & write messages
+  A user should be able to read and write messages
 
   Background:
-    Given I signin as a user
+    Given I sign in as a user
     And I own project "Shop"
-    And I visit project "Shop" wall page 
+    And I visit project "Shop" wall page
 
+  @javascript
   Scenario: Write comment
     Given I write new comment "my special test message"
     Then I should see project wall note "my special test message"
 
-    Then I visit project "Shop" wall page 
+    Then I visit project "Shop" wall page
     And I should see project wall note "my special test message"
similarity index 83%
rename from features/projects/wiki.feature
rename to features/project/wiki.feature
index 4441ada..5137056 100644 (file)
@@ -1,6 +1,6 @@
-Feature: Wiki
-  Background: 
-    Given I signin as a user
+Feature: Project Wiki
+  Background:
+    Given I sign in as a user
     And I own project "Shop"
     Given I visit project wiki page
 
diff --git a/features/projects/deploy_keys.feature b/features/projects/deploy_keys.feature
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/features/projects/issues/labels.feature b/features/projects/issues/labels.feature
deleted file mode 100644 (file)
index 5a20bfd..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-Feature: Labels
-  Background:
-    Given I signin as a user
-    And I own project "Shop"
-    And project "Shop" have issues tags: 
-     | name    |
-     | bug     |
-     | feature |
-    Given I visit project "Shop" labels page 
-
-  Scenario: I should see active milestones
-    Then I should see label "bug"
-    And I should see label "feature"
diff --git a/features/projects/project.feature b/features/projects/project.feature
deleted file mode 100644 (file)
index 895a928..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Feature: Project
-  Background:
-    Given I signin as a user
-    And I own project "Shop"
-    And I visit project "Shop" page 
-
-  Scenario: I should see project activity
-
-  Scenario: I edit project
-
-  Scenario: I visit attachments
diff --git a/features/projects/snippets.feature b/features/projects/snippets.feature
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/features/projects/source/git_blame.feature b/features/projects/source/git_blame.feature
deleted file mode 100644 (file)
index 6aa6be4..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Feature: Browse git repo
-  Background: 
-    Given I signin as a user
-    And I own project "Shop"
-    Given I visit project source page
-
-  Scenario: I blame file
-    Given I click on file from repo
-    And I click blame button
-    Then I should see git file blame 
diff --git a/features/projects/web_hooks.feature b/features/projects/web_hooks.feature
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/features/step_definitions/common_steps.rb b/features/step_definitions/common_steps.rb
deleted file mode 100644 (file)
index e9023f9..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-include LoginHelpers
-
-Given /^I signin as a user$/ do
-  login_as :user
-end
-
-When /^I click link "(.*?)"$/ do |link|
-  click_link link
-end
-
-When /^I click button "(.*?)"$/ do |button|
-  click_button button
-end
-
-When /^I fill in "(.*?)" with "(.*?)"$/ do |field, value|
-  fill_in field, :with => value
-end
-
-Given /^show me page$/ do
-  save_and_open_page
-end
diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb
deleted file mode 100644 (file)
index 3ddc68e..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-Then /^I should see "(.*?)" link$/ do |arg1|
-  page.should have_link(arg1)
-end
-
-Then /^I should see "(.*?)" project link$/ do |arg1|
-  page.should have_link(arg1)
-end
-
-Then /^I should see project "(.*?)" activity feed$/ do |arg1|
-  project = Project.find_by_name(arg1)
-  page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}"
-end
-
-Given /^project "(.*?)" has push event$/ do |arg1|
-  @project = Project.find_by_name(arg1)
-
-  data = {
-    :before => "0000000000000000000000000000000000000000",
-    :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
-    :ref => "refs/heads/new_design",
-    :user_id => @user.id,
-    :user_name => @user.name,
-    :repository => {
-      :name => @project.name,
-      :url => "localhost/rubinius",
-      :description => "",
-      :homepage => "localhost/rubinius",
-      :private => true
-    }
-  }
-
-  @event = Event.create(
-    :project => @project,
-    :action => Event::Pushed,
-    :data => data,
-    :author_id => @user.id
-  )
-end
-
-Then /^I should see last push widget$/ do
-  page.should have_content "Your pushed to branch new_design"
-  page.should have_link "Create Merge Request"
-end
-
-Then /^I click "(.*?)" link$/ do |arg1|
-  click_link arg1 #Create Merge Request"
-end
-
-Then /^I see prefilled new Merge Request page$/ do
-  current_path.should == new_project_merge_request_path(@project)
-  find("#merge_request_source_branch").value.should == "new_design"
-  find("#merge_request_target_branch").value.should == "master"
-  find("#merge_request_title").value.should == "New Design"
-end
-
-Given /^I visit dashboard search page$/ do
-  visit search_path
-end
-
-Given /^I search for "(.*?)"$/ do |arg1|
-  fill_in "dashboard_search", :with => arg1
-  click_button "Search"
-end
-
-Then /^I should see issues assigned to me$/ do
-  issues = @user.issues
-  issues.each do |issue|
-    page.should have_content(issue.title[0..10])
-    page.should have_content(issue.project.name)
-  end
-end
-
-Then /^I should see my merge requests$/ do
-  merge_requests = @user.merge_requests
-  merge_requests.each do |mr|
-    page.should have_content(mr.title[0..10])
-    page.should have_content(mr.project.name)
-  end
-end
-
-Given /^I have assigned issues$/ do
-  project = Factory :project
-  project.add_access(@user, :read, :write)
-
-  issue1 = Factory :issue,
-   :author => @user,
-   :assignee => @user,
-   :project => project
-
-  issue2 = Factory :issue,
-   :author => @user,
-   :assignee => @user,
-   :project => project
-end
-
-Given /^I have authored merge requests$/ do
-  project1 = Factory :project
-
-  project2 = Factory :project
-
-  project1.add_access(@user, :read, :write)
-  project2.add_access(@user, :read, :write)
-
-  merge_request1 = Factory :merge_request,
-   :author => @user,
-   :project => project1
-
-  merge_request2 = Factory :merge_request,
-   :author => @user,
-   :project => project2
-end
-
-Given /^user with name "(.*?)" joined project "(.*?)"$/ do |user_name, project_name|
-  user = Factory.create(:user, {name: user_name})
-  project = Project.find_by_name project_name
-  Event.create(
-    project: project,
-    author_id: user.id,
-    action: Event::Joined
-  )
-end
-
-Given /^user with name "(.*?)" left project "(.*?)"$/ do |user_name, project_name|
-  user = User.find_by_name user_name
-  project = Project.find_by_name project_name
-  Event.create(
-    project: project,
-    author_id: user.id,
-    action: Event::Left
-  )
-end
-
-Then /^I should see "(.*?)" event$/ do |event_text|
-  page.should have_content(event_text)
-end
-
diff --git a/features/step_definitions/profile/profile_keys_steps.rb b/features/step_definitions/profile/profile_keys_steps.rb
deleted file mode 100644 (file)
index 25926c5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-Given /^I visit profile keys page$/ do
-  visit keys_path
-end
-
-Then /^I should see my ssh keys$/ do
-  @user.keys.each do |key|
-    page.should have_content(key.title)
-  end
-end
-
-Given /^I have ssh keys:$/ do |table|
-  table.hashes.each do |row|
-    Factory :key, :user => @user, :title => row[:title], :key => "jfKLJDFKSFJSHFJ#{row[:title]}"
-  end
-end
-
-Given /^I submit new ssh key "(.*?)"$/ do |arg1|
-  fill_in "key_title", :with => arg1
-  fill_in "key_key", :with => "ssh-rsa publickey234="
-  click_button "Save"
-end
-
-Then /^I should see new ssh key "(.*?)"$/ do |arg1|
-  key = Key.find_by_title(arg1)
-  page.should have_content(key.title)
-  page.should have_content(key.key)
-  current_path.should == key_path(key)
-end
-
-Then /^I should not see "(.*?)" ssh key$/ do |arg1|
-  within "#keys-table" do
-    page.should_not have_content(arg1)
-  end
-end
diff --git a/features/step_definitions/profile/profile_steps.rb b/features/step_definitions/profile/profile_steps.rb
deleted file mode 100644 (file)
index 525d43f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-Then /^I should see my profile info$/ do
-  page.should have_content "Profile"
-  page.should have_content @user.name
-  page.should have_content @user.email
-end
-
-Then /^I change my password$/ do
-  fill_in "user_password", :with => "222333"
-  fill_in "user_password_confirmation", :with => "222333"
-  click_button "Save"
-end
-
-Then /^I should be redirected to sign in page$/ do
-  current_path.should == new_user_session_path
-end
-
-Then /^I reset my token$/ do
-  @old_token = @user.private_token
-  click_button "Reset"
-end
-
-Then /^I should see new token$/ do
-  find("#token").value.should_not == @old_token
-  find("#token").value.should == @user.reload.private_token
-end
-
-Then /^I change my contact info$/ do
-  fill_in "user_skype", :with => "testskype"
-  fill_in "user_linkedin", :with => "testlinkedin"
-  fill_in "user_twitter", :with => "testtwitter"
-  click_button "Save"
-  @user.reload
-end
-
-Then /^I should see new contact info$/ do
-  @user.skype.should == 'testskype'
-  @user.linkedin.should == 'testlinkedin'
-  @user.twitter.should == 'testtwitter'
-end
diff --git a/features/step_definitions/project/browse_code_steps.rb b/features/step_definitions/project/browse_code_steps.rb
deleted file mode 100644 (file)
index d2ed9a0..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Then /^I should see files from repository$/ do
-  page.should have_content("app")
-  page.should have_content("History")
-  page.should have_content("Gemfile")
-end
-
-Then /^I should see files from repository for "(.*?)"$/ do |arg1|
-  current_path.should == tree_project_ref_path(@project, arg1)
-  page.should have_content("app")
-  page.should have_content("History")
-  page.should have_content("Gemfile")
-end
-
-Given /^I click on file from repo$/ do
-  click_link "Gemfile"
-end
-
-Then /^I should see it content$/ do
-  page.should have_content("rubygems.org")
-end
-
-Given /^I click on raw button$/ do
-  click_link "raw"
-end
-
-Then /^I should see raw file content$/ do
-  page.source.should == ValidCommit::BLOB_FILE
-end
-
-Given /^I click blame button$/ do
-  click_link "blame"
-end
-
-Then /^I should see git file blame$/ do
-  page.should have_content("rubygems.org")
-  page.should have_content("Dmitriy Zaporozhets")
-  page.should have_content("bc3735004cb Moving to rails 3.2")
-end
diff --git a/features/step_definitions/project/project_commits_steps.rb b/features/step_definitions/project/project_commits_steps.rb
deleted file mode 100644 (file)
index 7f20ade..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-Then /^I see project commits$/ do
-  current_path.should == project_commits_path(@project)
-
-  commit = @project.commit
-  page.should have_content(@project.name)
-  page.should have_content(commit.message)
-  page.should have_content(commit.id.to_s[0..5])
-end
-
-Given /^I click atom feed link$/ do
-  click_link "Feed"
-end
-
-Then /^I see commits atom feed$/ do
-  commit = CommitDecorator.decorate(@project.commit)
-  page.response_headers['Content-Type'].should have_content("application/atom+xml")
-  page.body.should have_selector("title", :text => "Recent commits to #{@project.name}")
-  page.body.should have_selector("author email", :text => commit.author_email)
-  page.body.should have_selector("entry summary", :text => commit.description)
-end
-
-Then /^I see commit info$/ do
-  page.should have_content ValidCommit::MESSAGE
-  page.should have_content "Showing 1 changed file"
-end
-
-Given /^I fill compare fields with refs$/ do
-  fill_in "from", :with => "master"
-  fill_in "to", :with => "stable"
-  click_button "Compare"
-end
-
-Given /^I see compared refs$/ do
-  page.should have_content "Commits (27)"
-  page.should have_content "Compare View"
-  page.should have_content "Showing 73 changed files"
-end
-
-Then /^I should see "(.*?)" recent branches list$/ do |arg1|
-  page.should have_content("Branches")
-  page.should have_content("master")
-end
-
-Then /^I should see "(.*?)" all branches list$/ do |arg1|
-  page.should have_content("Branches")
-  page.should have_content("master")
-end
-
-Then /^I should see "(.*?)" all tags list$/ do |arg1|
-  page.should have_content("Tags")
-  page.should have_content("v1.2.1")
-end
-
-Then /^I should see "(.*?)" protected branches list$/ do |arg1|
-  within "table" do
-    page.should have_content "stable"
-    page.should_not have_content "master"
-  end
-end
-
-Given /^project "(.*?)" has protected branches$/ do |arg1|
-  project = Project.find_by_name(arg1)
-  project.protected_branches.create(:name => "stable")
-end
diff --git a/features/step_definitions/project/project_issues_steps.rb b/features/step_definitions/project/project_issues_steps.rb
deleted file mode 100644 (file)
index d78da53..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-Given /^project "(.*?)" have "(.*?)" open issue$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-  Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first)
-end
-
-Given /^project "(.*?)" have "(.*?)" closed issue$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-  Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first, :closed => true)
-end
-
-Given /^I should see "(.*?)" in issues$/ do |arg1|
-  page.should have_content arg1
-end
-
-Given /^I should not see "(.*?)" in issues$/ do |arg1|
-  page.should_not have_content arg1
-end
-
-Then /^I should see issue "(.*?)"$/ do |arg1|
-  issue = Issue.find_by_title(arg1)
-  page.should have_content issue.title
-  page.should have_content issue.author_name
-  page.should have_content issue.project.name
-end
-
-Given /^I submit new issue "(.*?)"$/ do |arg1|
-  fill_in "issue_title", with: arg1
-  click_button "Submit new issue"
-end
-
-Given /^project "(.*?)" have issues tags:$/ do |arg1, table|
-  project = Project.find_by_name(arg1)
-  table.hashes.each do |hash|
-    Factory :issue,
-      project: project,
-      label_list: [hash[:name]]
-  end
-end
-
-Given /^I visit project "(.*?)" labels page$/ do |arg1|
-  visit project_labels_path(Project.find_by_name(arg1))
-end
-
-Then /^I should see label "(.*?)"$/ do |arg1|
-  within ".labels-table" do
-    page.should have_content arg1
-  end
-end
-
-Given /^I fill in issue search with "(.*?)"$/ do |arg1|
-  # Because fill_in, with: "" triggers nothing
-  # we need to trigger a keyup event
-  if arg1 == ''
-    page.execute_script("$('.issue_search').val('').keyup();");
-  end
-  fill_in 'issue_search', with: arg1
-end
-
-When /^I select milestone "(.*?)"$/ do |milestone_title|
-  select milestone_title, from: "milestone_id"
-end
-
-Then /^I should see selected milestone with title "(.*?)"$/ do |milestone_title|
-  issues_milestone_selector = "#issue_milestone_id_chzn/a"
-  wait_until{ page.has_content?("Details") }
-  page.find(issues_milestone_selector).should have_content(milestone_title)
-end
-
-When /^I select first assignee from "(.*?)" project$/ do |project_name|
-  project = Project.find_by_name project_name
-  first_assignee = project.users.first
-  select first_assignee.name, from: "assignee_id"
-end
-
-Then /^I should see first assignee from "(.*?)" as selected assignee$/ do |project_name|
-  issues_assignee_selector = "#issue_assignee_id_chzn/a"
-  wait_until{ page.has_content?("Details") }
-  project = Project.find_by_name project_name
-  assignee_name = project.users.first.name
-  page.find(issues_assignee_selector).should have_content(assignee_name)
-end
diff --git a/features/step_definitions/project/project_merge_requests_steps.rb b/features/step_definitions/project/project_merge_requests_steps.rb
deleted file mode 100644 (file)
index fddb18a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Given /^project "(.*?)" have "(.*?)" open merge request$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-  Factory.create(:merge_request, :title => arg2, :project => project, :author => project.users.first)
-end
-
-Given /^project "(.*?)" have "(.*?)" closed merge request$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-  Factory.create(:merge_request, :title => arg2, :project => project, :author => project.users.first, :closed => true)
-end
-
-Then /^I should see "(.*?)" in merge requests$/ do |arg1|
-  page.should have_content arg1
-end
-
-Then /^I should not see "(.*?)" in merge requests$/ do |arg1|
-  page.should_not have_content arg1
-end
-
-Then /^I should see merge request "(.*?)"$/ do |arg1|
-  merge_request = MergeRequest.find_by_title(arg1)
-  page.should have_content(merge_request.title[0..10])
-  page.should have_content(merge_request.target_branch)
-  page.should have_content(merge_request.source_branch)
-end
-
-Given /^I submit new merge request "(.*?)"$/ do |arg1|
-  fill_in "merge_request_title", :with => arg1
-  select "master", :from => "merge_request_source_branch"
-  select "stable", :from => "merge_request_target_branch"
-  click_button "Save"
-end
-
-Then /^I should see closed merge request "(.*?)"$/ do |arg1|
-  mr = MergeRequest.find_by_title(arg1)
-  mr.closed.should be_true
-  page.should have_content "Closed by"
-end
-
diff --git a/features/step_definitions/project/project_milestones_steps.rb b/features/step_definitions/project/project_milestones_steps.rb
deleted file mode 100644 (file)
index 936c52d..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-Given /^project "(.*?)" has milestone "(.*?)"$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-
-  milestone = Factory :milestone,
-    :title => arg2,
-    :project => project
-
-  3.times do |i|
-    issue = Factory :issue,
-      :project => project,
-      :milestone => milestone
-  end
-end
-
-Then /^I should see active milestones$/ do
-  milestone = @project.milestones.first
-  page.should have_content(milestone.title[0..10])
-  page.should have_content(milestone.expires_at)
-  page.should have_content("Browse Issues")
-end
-
-Then /^I should see milestone "(.*?)"$/ do |arg1|
-  milestone = @project.milestones.find_by_title(arg1)
-  page.should have_content(milestone.title[0..10])
-  page.should have_content(milestone.expires_at)
-  page.should have_content("Browse Issues")
-end
-
-Given /^I submit new milestone "(.*?)"$/ do |arg1|
-  fill_in "milestone_title", :with => arg1
-  click_button "Create milestone"
-end
-
diff --git a/features/step_definitions/project/project_team_steps.rb b/features/step_definitions/project/project_team_steps.rb
deleted file mode 100644 (file)
index 91885e4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-Given /^gitlab user "(.*?)"$/ do |arg1|
-  Factory :user, :name => arg1
-end
-
-Given /^"(.*?)" is "(.*?)" developer$/ do |arg1, arg2|
-  user = User.find_by_name(arg1)
-  project = Project.find_by_name(arg2)
-  project.add_access(user, :write)
-end
-
-Then /^I should be able to see myself in team$/ do
-  page.should have_content(@user.name)
-  page.should have_content(@user.email)
-end
-
-Then /^I should see "(.*?)" in team list$/ do |arg1|
-  user = User.find_by_name(arg1)
-  page.should have_content(user.name)
-  page.should have_content(user.email)
-end
-
-Given /^I select "(.*?)" as "(.*?)"$/ do |arg1, arg2|
-  user = User.find_by_name(arg1)
-  within "#new_team_member" do
-    select user.name, :from => "user_ids"
-    select arg2, :from => "project_access"
-  end
-  click_button "Save"
-end
-
-Then /^I should see "(.*?)" in team list as "(.*?)"$/ do |arg1, arg2|
-  user = User.find_by_name(arg1)
-  role_id = find(".user_#{user.id} #team_member_project_access").value
-  role_id.should == UsersProject.access_roles[arg2].to_s
-end
-
-Given /^I change "(.*?)" role to "(.*?)"$/ do |arg1, arg2|
-  user = User.find_by_name(arg1)
-  within ".user_#{user.id}" do
-    select arg2, :from => "team_member_project_access"
-  end
-end
-
-Then /^I should see "(.*?)" team profile$/ do |arg1|
-  user = User.find_by_name(arg1)
-  page.should have_content(user.name)
-  page.should have_content(user.email)
-  page.should have_content("To team list")
-end
-
-Then /^I should not see "(.*?)" in team list$/ do |arg1|
-  user = User.find_by_name(arg1)
-  page.should_not have_content(user.name)
-  page.should_not have_content(user.email)
-end
diff --git a/features/step_definitions/project/project_wiki_steps.rb b/features/step_definitions/project/project_wiki_steps.rb
deleted file mode 100644 (file)
index 31fc050..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-Given /^I create Wiki page$/ do
-  fill_in "Title", :with => 'Test title'
-  fill_in "Content", :with => '[link test](test)'
-  click_on "Save"
-end
-
-Then /^I should see newly created wiki page$/ do
-  page.should have_content("Test title")
-  page.should have_content("link test")
-
-  click_link "link test"
-
-  page.should have_content("Editing page")
-end
diff --git a/features/step_definitions/project/projects_steps.rb b/features/step_definitions/project/projects_steps.rb
deleted file mode 100644 (file)
index d22b805..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-When /^I visit new project page$/ do
-  visit new_project_path
-end
-
-When /^fill project form with valid data$/ do
-  fill_in 'project_name', :with => 'NewProject'
-  fill_in 'project_code', :with => 'NPR'
-  fill_in 'project_path', :with => 'newproject'
-  click_button "Create project"
-end
-
-Then /^I should see project page$/ do
-  current_path.should == project_path(Project.last)
-  page.should have_content('NewProject')
-end
-
-Then /^I should see empty project instuctions$/ do
-  page.should have_content("git init")
-  page.should have_content("git remote")
-  page.should have_content(Project.last.url_to_repo)
-end
-
-Given /^I own project "(.*?)"$/ do |arg1|
-  @project = Factory :project, :name => arg1
-  @project.add_access(@user, :admin)
-end
-
-Given /^I visit project "(.*?)" wall page$/ do |arg1|
-  project = Project.find_by_name(arg1)
-  visit wall_project_path(project)
-end
-
-Then /^I should see project wall note "(.*?)"$/ do |arg1|
-  page.should have_content arg1
-end
-
-Given /^project "(.*?)" has comment "(.*?)"$/ do |arg1, arg2|
-  project = Project.find_by_name(arg1)
-  project.notes.create(:note => arg1, :author => project.users.first)
-end
-
-Given /^I write new comment "(.*?)"$/ do |arg1|
-  fill_in "note_note", :with => arg1
-  click_button "Add Comment"
-end
-
-Given /^I visit project "(.*?)" page$/ do |arg1|
-  project = Project.find_by_name(arg1)
-  visit project_path(project)
-end
-
-Given /^I visit project "(.*?)" network page$/ do |arg1|
-  project = Project.find_by_name(arg1)
-
-  # Stub out find_all to speed this up (10 commits vs. 650)
-  commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10})
-  Grit::Commit.stub(:find_all).and_return(commits)
-
-  visit graph_project_path(project)
-end
-
-Given /^page should have network graph$/ do
-  page.should have_content "Project Network Graph"
-  within ".graph" do
-    page.should have_content "master"
-    page.should have_content "scss_refactor..."
-  end
-end
-
-Given /^I leave a comment like "(.*?)"$/ do |arg1|
-  fill_in "note_note", :with => arg1
-  click_button "Add Comment"
-end
-
-Then /^I should see comment "(.*?)"$/ do |arg1|
-  page.should have_content(arg1)
-end
diff --git a/features/step_definitions/visit_steps.rb b/features/step_definitions/visit_steps.rb
deleted file mode 100644 (file)
index 35fc6d4..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-Given /^I visit project "(.*?)" issues page$/ do |arg1|
-  visit project_issues_path(Project.find_by_name(arg1))
-end
-
-Given /^I visit issue page "(.*?)"$/ do |arg1|
-  issue = Issue.find_by_title(arg1)
-  visit project_issue_path(issue.project, issue)
-end
-
-Given /^I visit project "(.*?)" merge requests page$/ do |arg1|
-  visit project_merge_requests_path(Project.find_by_name(arg1))
-end
-
-Given /^I visit merge request page "(.*?)"$/ do |arg1|
-  mr = MergeRequest.find_by_title(arg1)
-  visit project_merge_request_path(mr.project, mr)
-end
-
-Given /^I visit project "(.*?)" milestones page$/ do |arg1|
-  @project = Project.find_by_name(arg1)
-  visit project_milestones_path(@project)
-end
-
-Given /^I visit project commits page$/ do
-  visit project_commits_path(@project)
-end
-
-Given /^I visit compare refs page$/ do
-  visit compare_project_commits_path(@project)
-end
-
-Given /^I visit project branches page$/ do
-  visit branches_project_repository_path(@project)
-end
-
-Given /^I visit project commit page$/ do
-  visit project_commit_path(@project, ValidCommit::ID)
-end
-
-Given /^I visit project tags page$/ do
-  visit tags_project_repository_path(@project)
-end
-
-Given /^I click on commit link$/ do
-  visit project_commit_path(@project, ValidCommit::ID)
-end
-
-Given /^I visit project source page$/ do
-  visit tree_project_ref_path(@project, @project.root_ref)
-end
-
-Given /^I visit project source page for "(.*?)"$/ do |arg1|
-  visit tree_project_ref_path(@project, arg1)
-end
-
-Given /^I visit blob file from repo$/ do
-  visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
-end
-
-Given /^I visit project "(.*?)" team page$/ do |arg1|
-  visit team_project_path(Project.find_by_name(arg1))
-end
-
-Given /^I visit project wiki page$/ do
-  visit project_wiki_path(@project, :index)
-end
-
-Given /^I visit profile page$/ do
-  visit profile_path
-end
-
-Given /^I visit profile token page$/ do
-  visit profile_token_path
-end
-
-Given /^I visit profile password page$/ do
-  visit profile_password_path
-end
-
-Given /^I visit dashboard page$/ do
-  visit dashboard_path
-end
-
-Given /^I visit dashboard issues page$/ do
-  visit dashboard_issues_path
-end
-
-Given /^I visit dashboard merge requests page$/ do
-  visit dashboard_merge_requests_path
-end
-
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb
new file mode 100644 (file)
index 0000000..6c603bb
--- /dev/null
@@ -0,0 +1,92 @@
+class Dashboard < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  Then 'I should see "New Project" link' do
+    page.should have_link "New Project"
+  end
+
+  Then 'I should see "Shop" project link' do
+    page.should have_link "Shop"
+  end
+
+  Then 'I should see project "Shop" activity feed' do
+    project = Project.find_by_name("Shop")
+    page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}"
+  end
+
+  Then 'I should see last push widget' do
+    page.should have_content "Your pushed to branch new_design"
+    page.should have_link "Create Merge Request"
+  end
+
+  And 'I click "Create Merge Request" link' do
+    click_link "Create Merge Request"
+  end
+
+  Then 'I see prefilled new Merge Request page' do
+    current_path.should == new_project_merge_request_path(@project)
+    find("#merge_request_source_branch").value.should == "new_design"
+    find("#merge_request_target_branch").value.should == "master"
+    find("#merge_request_title").value.should == "New Design"
+  end
+
+  Given 'user with name "John Doe" joined project "Shop"' do
+    user = Factory.create(:user, {name: "John Doe"})
+    project = Project.find_by_name "Shop"
+    Event.create(
+      project: project,
+      author_id: user.id,
+      action: Event::Joined
+    )
+  end
+
+  Then 'I should see "John Doe joined project Shop" event' do
+    page.should have_content "John Doe joined project Shop"
+  end
+
+  And 'user with name "John Doe" left project "Shop"' do
+    user = User.find_by_name "John Doe"
+    project = Project.find_by_name "Shop"
+    Event.create(
+      project: project,
+      author_id: user.id,
+      action: Event::Left
+    )
+  end
+
+  Then 'I should see "John Doe left project Shop" event' do
+    page.should have_content "John Doe left project Shop"
+  end
+
+  And 'I own project "Shop"' do
+    @project = Factory :project, :name => 'Shop'
+    @project.add_access(@user, :admin)
+  end
+
+  And 'project "Shop" has push event' do
+    @project = Project.find_by_name("Shop")
+
+    data = {
+      :before => "0000000000000000000000000000000000000000",
+      :after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
+      :ref => "refs/heads/new_design",
+      :user_id => @user.id,
+      :user_name => @user.name,
+      :repository => {
+        :name => @project.name,
+        :url => "localhost/rubinius",
+        :description => "",
+        :homepage => "localhost/rubinius",
+        :private => true
+      }
+    }
+
+    @event = Event.create(
+      :project => @project,
+      :action => Event::Pushed,
+      :data => data,
+      :author_id => @user.id
+    )
+  end
+end
diff --git a/features/steps/dashboard/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb
new file mode 100644 (file)
index 0000000..9368782
--- /dev/null
@@ -0,0 +1,19 @@
+class DashboardIssues < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  Then 'I should see issues assigned to me' do
+    issues = @user.issues
+    issues.each do |issue|
+      page.should have_content(issue.title[0..10])
+      page.should have_content(issue.project.name)
+    end
+  end
+
+  And 'I have assigned issues' do
+    project = Factory :project
+    project.add_access(@user, :read, :write)
+
+    2.times { Factory :issue, :author => @user, :assignee => @user, :project => project }
+  end
+end
diff --git a/features/steps/dashboard/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb
new file mode 100644 (file)
index 0000000..fc339e7
--- /dev/null
@@ -0,0 +1,23 @@
+class DashboardMergeRequests < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  Then 'I should see my merge requests' do
+    merge_requests = @user.merge_requests
+    merge_requests.each do |mr|
+      page.should have_content(mr.title[0..10])
+      page.should have_content(mr.project.name)
+    end
+  end
+
+  And 'I have authored merge requests' do
+    project1 = Factory :project
+    project2 = Factory :project
+
+    project1.add_access(@user, :read, :write)
+    project2.add_access(@user, :read, :write)
+
+    merge_request1 = Factory :merge_request, :author => @user, :project => project1
+    merge_request2 = Factory :merge_request, :author => @user, :project => project2
+  end
+end
diff --git a/features/steps/dashboard/dashboard_search.rb b/features/steps/dashboard/dashboard_search.rb
new file mode 100644 (file)
index 0000000..e358589
--- /dev/null
@@ -0,0 +1,18 @@
+class DashboardSearch < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  Given 'I search for "Sho"' do
+    fill_in "dashboard_search", :with => "Sho"
+    click_button "Search"
+  end
+
+  Then 'I should see "Shop" project link' do
+    page.should have_link "Shop"
+  end
+
+  And 'I own project "Shop"' do
+    @project = Factory :project, :name => "Shop"
+    @project.add_access(@user, :admin)
+  end
+end
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
new file mode 100644 (file)
index 0000000..d3261a1
--- /dev/null
@@ -0,0 +1,44 @@
+class Profile < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  Then 'I should see my profile info' do
+    page.should have_content "Profile"
+    page.should have_content @user.name
+    page.should have_content @user.email
+  end
+
+  Then 'I change my contact info' do
+    fill_in "user_skype", :with => "testskype"
+    fill_in "user_linkedin", :with => "testlinkedin"
+    fill_in "user_twitter", :with => "testtwitter"
+    click_button "Save"
+    @user.reload
+  end
+
+  And 'I should see new contact info' do
+    @user.skype.should == 'testskype'
+    @user.linkedin.should == 'testlinkedin'
+    @user.twitter.should == 'testtwitter'
+  end
+
+  Then 'I change my password' do
+    fill_in "user_password", :with => "222333"
+    fill_in "user_password_confirmation", :with => "222333"
+    click_button "Save"
+  end
+
+  And 'I should be redirected to sign in page' do
+    current_path.should == new_user_session_path
+  end
+
+  Then 'I reset my token' do
+    @old_token = @user.private_token
+    click_button "Reset"
+  end
+
+  And 'I should see new token' do
+    find("#token").value.should_not == @old_token
+    find("#token").value.should == @user.reload.private_token
+  end
+end
diff --git a/features/steps/profile/profile_ssh_keys.rb b/features/steps/profile/profile_ssh_keys.rb
new file mode 100644 (file)
index 0000000..96df2d7
--- /dev/null
@@ -0,0 +1,48 @@
+class ProfileSshKeys < Spinach::FeatureSteps
+  include SharedAuthentication
+
+  Then 'I should see my ssh keys' do
+    @user.keys.each do |key|
+      page.should have_content(key.title)
+    end
+  end
+
+  Given 'I click link "Add new"' do
+    click_link "Add new"
+  end
+
+  And 'I submit new ssh key "Laptop"' do
+    fill_in "key_title", :with => "Laptop"
+    fill_in "key_key", :with => "ssh-rsa publickey234="
+    click_button "Save"
+  end
+
+  Then 'I should see new ssh key "Laptop"' do
+    key = Key.find_by_title("Laptop")
+    page.should have_content(key.title)
+    page.should have_content(key.key)
+    current_path.should == key_path(key)
+  end
+
+  Given 'I click link "Work"' do
+    click_link "Work"
+  end
+
+  And 'I click link "Remove"' do
+    click_link "Remove"
+  end
+
+  Then 'I visit profile keys page' do
+    visit keys_path
+  end
+
+  And 'I should not see "Work" ssh key' do
+    within "#keys-table" do
+      page.should_not have_content "Work"
+    end
+  end
+
+  And 'I have ssh key "ssh-rsa Work"' do
+    Factory :key, :user => @user, :title => "ssh-rsa Work", :key => "jfKLJDFKSFJSHFJssh-rsa Work"
+  end
+end
diff --git a/features/steps/project/create_project.rb b/features/steps/project/create_project.rb
new file mode 100644 (file)
index 0000000..6d2ca3f
--- /dev/null
@@ -0,0 +1,22 @@
+class CreateProject < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedPaths
+
+  And 'fill project form with valid data' do
+    fill_in 'project_name', :with => 'NewProject'
+    fill_in 'project_code', :with => 'NPR'
+    fill_in 'project_path', :with => 'newproject'
+    click_button "Create project"
+  end
+
+  Then 'I should see project page' do
+    current_path.should == project_path(Project.last)
+    page.should have_content "NewProject"
+  end
+
+  And 'I should see empty project instuctions' do
+    page.should have_content "git init"
+    page.should have_content "git remote"
+    page.should have_content Project.last.url_to_repo
+  end
+end
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
new file mode 100644 (file)
index 0000000..f33f12e
--- /dev/null
@@ -0,0 +1,5 @@
+class Projects < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+end
diff --git a/features/steps/project/project_browse_branches.rb b/features/steps/project/project_browse_branches.rb
new file mode 100644 (file)
index 0000000..2f6e185
--- /dev/null
@@ -0,0 +1,35 @@
+class ProjectBrowseBranches < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should see "Shop" recent branches list' do
+    page.should have_content "Branches"
+    page.should have_content "master"
+  end
+
+  Given 'I click link "All"' do
+    click_link "All"
+  end
+
+  Then 'I should see "Shop" all branches list' do
+    page.should have_content "Branches"
+    page.should have_content "master"
+  end
+
+  Given 'I click link "Protected"' do
+    click_link "Protected"
+  end
+
+  Then 'I should see "Shop" protected branches list' do
+    within "table" do
+      page.should have_content "stable"
+      page.should_not have_content "master"
+    end
+  end
+
+  And 'project "Shop" has protected branches' do
+    project = Project.find_by_name("Shop")
+    project.protected_branches.create(:name => "stable")
+  end
+end
diff --git a/features/steps/project/project_browse_commits.rb b/features/steps/project/project_browse_commits.rb
new file mode 100644 (file)
index 0000000..0147998
--- /dev/null
@@ -0,0 +1,47 @@
+class ProjectBrowseCommits < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I see project commits' do
+    current_path.should == project_commits_path(@project)
+
+    commit = @project.commit
+    page.should have_content(@project.name)
+    page.should have_content(commit.message)
+    page.should have_content(commit.id.to_s[0..5])
+  end
+
+  Given 'I click atom feed link' do
+    click_link "Feed"
+  end
+
+  Then 'I see commits atom feed' do
+    commit = CommitDecorator.decorate(@project.commit)
+    page.response_headers['Content-Type'].should have_content("application/atom+xml")
+    page.body.should have_selector("title", :text => "Recent commits to #{@project.name}")
+    page.body.should have_selector("author email", :text => commit.author_email)
+    page.body.should have_selector("entry summary", :text => commit.description)
+  end
+
+  Given 'I click on commit link' do
+    visit project_commit_path(@project, ValidCommit::ID)
+  end
+
+  Then 'I see commit info' do
+    page.should have_content ValidCommit::MESSAGE
+    page.should have_content "Showing 1 changed file"
+  end
+
+  And 'I fill compare fields with refs' do
+    fill_in "from", :with => "master"
+    fill_in "to", :with => "stable"
+    click_button "Compare"
+  end
+
+  And 'I see compared refs' do
+    page.should have_content "Commits (27)"
+    page.should have_content "Compare View"
+    page.should have_content "Showing 73 changed files"
+  end
+end
diff --git a/features/steps/project/project_browse_files.rb b/features/steps/project/project_browse_files.rb
new file mode 100644 (file)
index 0000000..67c553c
--- /dev/null
@@ -0,0 +1,34 @@
+class ProjectBrowseFiles < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should see files from repository' do
+    page.should have_content "app"
+    page.should have_content "History"
+    page.should have_content "Gemfile"
+  end
+
+  Then 'I should see files from repository for "8470d70"' do
+    current_path.should == tree_project_ref_path(@project, "8470d70")
+    page.should have_content "app"
+    page.should have_content "History"
+    page.should have_content "Gemfile"
+  end
+
+  Given 'I click on "Gemfile" file in repo' do
+    click_link "Gemfile"
+  end
+
+  Then 'I should see it content' do
+    page.should have_content "rubygems.org"
+  end
+
+  And 'I click link "raw"' do
+    click_link "raw"
+  end
+
+  Then 'I should see raw file content' do
+    page.source.should == ValidCommit::BLOB_FILE
+  end
+end
diff --git a/features/steps/project/project_browse_git_repo.rb b/features/steps/project/project_browse_git_repo.rb
new file mode 100644 (file)
index 0000000..e966f40
--- /dev/null
@@ -0,0 +1,19 @@
+class ProjectBrowseGitRepo < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Given 'I click on "Gemfile" file in repo' do
+    click_link "Gemfile"
+  end
+
+  And 'I click blame button' do
+    click_link "blame"
+  end
+
+  Then 'I should see git file blame' do
+    page.should have_content "rubygems.org"
+    page.should have_content "Dmitriy Zaporozhets"
+    page.should have_content "bc3735004cb Moving to rails 3.2"
+  end
+end
diff --git a/features/steps/project/project_browse_tags.rb b/features/steps/project/project_browse_tags.rb
new file mode 100644 (file)
index 0000000..0cbfa0d
--- /dev/null
@@ -0,0 +1,10 @@
+class ProjectBrowseTags < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should see "Shop" all tags list' do
+    page.should have_content "Tags"
+    page.should have_content "v1.2.1"
+  end
+end
diff --git a/features/steps/project/project_comment_commit.rb b/features/steps/project/project_comment_commit.rb
new file mode 100644 (file)
index 0000000..cb8385e
--- /dev/null
@@ -0,0 +1,6 @@
+class ProjectCommentCommit < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedNote
+  include SharedPaths
+end
diff --git a/features/steps/project/project_issues.rb b/features/steps/project/project_issues.rb
new file mode 100644 (file)
index 0000000..64af244
--- /dev/null
@@ -0,0 +1,134 @@
+class ProjectIssues < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedNote
+  include SharedPaths
+
+  Given 'I should see "Release 0.4" in issues' do
+    page.should have_content "Release 0.4"
+  end
+
+  And 'I should not see "Release 0.3" in issues' do
+    page.should_not have_content "Release 0.3"
+  end
+
+  Given 'I click link "Closed"' do
+    click_link "Closed"
+  end
+
+  Then 'I should see "Release 0.3" in issues' do
+    page.should have_content "Release 0.3"
+  end
+
+  And 'I should not see "Release 0.4" in issues' do
+    page.should_not have_content "Release 0.4"
+  end
+
+  Given 'I click link "All"' do
+    click_link "All"
+  end
+
+  Given 'I click link "Release 0.4"' do
+    click_link "Release 0.4"
+  end
+
+  Then 'I should see issue "Release 0.4"' do
+    page.should have_content "Release 0.4"
+  end
+
+  Given 'I click link "New Issue"' do
+    click_link "New Issue"
+  end
+
+  And 'I submit new issue "500 error on profile"' do
+    fill_in "issue_title", :with => "500 error on profile"
+    click_button "Submit new issue"
+  end
+
+  Given 'I click link "500 error on profile"' do
+    click_link "500 error on profile"
+  end
+
+  Then 'I should see issue "500 error on profile"' do
+    issue = Issue.find_by_title("500 error on profile")
+    page.should have_content issue.title
+    page.should have_content issue.author_name
+    page.should have_content issue.project.name
+  end
+
+  Given 'I fill in issue search with "Release"' do
+    fill_in 'issue_search', with: "Release"
+  end
+
+  Given 'I fill in issue search with "Bug"' do
+    fill_in 'issue_search', with: "Bug"
+  end
+
+  And 'I fill in issue search with "0.3"' do
+    fill_in 'issue_search', with: "0.3"
+  end
+
+  And 'I fill in issue search with "Something"' do
+    fill_in 'issue_search', with: "Something"
+  end
+
+  And 'I fill in issue search with ""' do
+    page.execute_script("$('.issue_search').val('').keyup();");
+    fill_in 'issue_search', with: ""
+  end
+
+  Given 'project "Shop" has milestone "v2.2"' do
+    project = Project.find_by_name("Shop")
+    milestone = Factory :milestone, :title => "v2.2", :project => project
+
+    3.times { Factory :issue, :project => project, :milestone => milestone }
+  end
+
+  And 'project "Shop" has milestone "v3.0"' do
+    project = Project.find_by_name("Shop")
+    milestone = Factory :milestone, :title => "v3.0", :project => project
+
+    3.times { Factory :issue, :project => project, :milestone => milestone }
+  end
+
+  When 'I select milestone "v3.0"' do
+    select "v3.0", from: "milestone_id"
+  end
+
+  Then 'I should see selected milestone with title "v3.0"' do
+    issues_milestone_selector = "#issue_milestone_id_chzn/a"
+    wait_until { page.has_content?("Details") }
+    page.find(issues_milestone_selector).should have_content("v3.0")
+  end
+
+  When 'I select first assignee from "Shop" project' do
+    project = Project.find_by_name "Shop"
+    first_assignee = project.users.first
+    select first_assignee.name, from: "assignee_id"
+  end
+
+  Then 'I should see first assignee from "Shop" as selected assignee' do
+    issues_assignee_selector = "#issue_assignee_id_chzn/a"
+    wait_until { page.has_content?("Details") }
+    project = Project.find_by_name "Shop"
+    assignee_name = project.users.first.name
+    page.find(issues_assignee_selector).should have_content(assignee_name)
+  end
+
+  And 'project "Shop" have "Release 0.4" open issue' do
+    project = Project.find_by_name("Shop")
+    Factory.create(:issue,
+      :title => "Release 0.4",
+      :project => project,
+      :author => project.users.first)
+  end
+
+  And 'project "Shop" have "Release 0.3" closed issue' do
+    project = Project.find_by_name("Shop")
+    Factory.create(:issue,
+      :title => "Release 0.3",
+      :project => project,
+      :author => project.users.first,
+      :closed => true)
+  end
+end
diff --git a/features/steps/project/project_labels.rb b/features/steps/project/project_labels.rb
new file mode 100644 (file)
index 0000000..1a347bf
--- /dev/null
@@ -0,0 +1,24 @@
+class ProjectLabels < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should see label "bug"' do
+    within ".labels-table" do
+      page.should have_content "bug"
+    end
+  end
+
+  And 'I should see label "feature"' do
+    within ".labels-table" do
+      page.should have_content "feature"
+    end
+  end
+
+  And 'project "Shop" have issues tags: "bug", "feature"' do
+    project = Project.find_by_name("Shop")
+    ['bug', 'feature'].each do |label|
+      Factory :issue, project: project, label_list: label
+    end
+  end
+end
diff --git a/features/steps/project/project_merge_requests.rb b/features/steps/project/project_merge_requests.rb
new file mode 100644 (file)
index 0000000..80e8390
--- /dev/null
@@ -0,0 +1,80 @@
+class ProjectMergeRequests < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedNote
+  include SharedPaths
+
+  Then 'I should see "Bug NS-04" in merge requests' do
+    page.should have_content "Bug NS-04"
+  end
+
+  And 'I should not see "Feature NS-03" in merge requests' do
+    page.should_not have_content "Feature NS-03"
+  end
+
+  Given 'I click link "Closed"' do
+    click_link "Closed"
+  end
+
+  Then 'I should see "Feature NS-03" in merge requests' do
+    page.should have_content "Feature NS-03"
+  end
+
+  And 'I should not see "Bug NS-04" in merge requests' do
+    page.should_not have_content "Bug NS-04"
+  end
+
+  Given 'I click link "All"' do
+    click_link "All"
+  end
+
+  Given 'I click link "Bug NS-04"' do
+    click_link "Bug NS-04"
+  end
+
+  Then 'I should see merge request "Bug NS-04"' do
+    page.should have_content "Bug NS-04"
+  end
+
+  And 'I click link "Close"' do
+    click_link "Close"
+  end
+
+  Then 'I should see closed merge request "Bug NS-04"' do
+    mr = MergeRequest.find_by_title("Bug NS-04")
+    mr.closed.should be_true
+    page.should have_content "Closed by"
+  end
+
+  Given 'I click link "New Merge Request"' do
+    click_link "New Merge Request"
+  end
+
+  And 'I submit new merge request "Wiki Feature"' do
+    fill_in "merge_request_title", :with => "Wiki Feature"
+    select "master", :from => "merge_request_source_branch"
+    select "stable", :from => "merge_request_target_branch"
+    click_button "Save"
+  end
+
+  Then 'I should see merge request "Wiki Feature"' do
+    page.should have_content "Wiki Feature"
+  end
+
+  And 'project "Shop" have "Bug NS-04" open merge request' do
+    project = Project.find_by_name("Shop")
+    Factory.create(:merge_request,
+      :title => "Bug NS-04",
+      :project => project,
+      :author => project.users.first)
+  end
+
+  And 'project "Shop" have "Feature NS-03" closed merge request' do
+    project = Project.find_by_name("Shop")
+    Factory.create(:merge_request,
+      :title => "Feature NS-03",
+      :project => project,
+      :author => project.users.first,
+      :closed => true)
+  end
+end
diff --git a/features/steps/project/project_milestones.rb b/features/steps/project/project_milestones.rb
new file mode 100644 (file)
index 0000000..83ed685
--- /dev/null
@@ -0,0 +1,39 @@
+class ProjectMilestones < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should see milestone "v2.2"' do
+    milestone = @project.milestones.find_by_title("v2.2")
+    page.should have_content(milestone.title[0..10])
+    page.should have_content(milestone.expires_at)
+    page.should have_content("Browse Issues")
+  end
+
+  Given 'I click link "v2.2"' do
+    click_link "v2.2"
+  end
+
+  Given 'I click link "New Milestone"' do
+    click_link "New Milestone"
+  end
+
+  And 'I submit new milestone "v2.3"' do
+    fill_in "milestone_title", :with => "v2.3"
+    click_button "Create milestone"
+  end
+
+  Then 'I should see milestone "v2.3"' do
+    milestone = @project.milestones.find_by_title("v2.3")
+    page.should have_content(milestone.title[0..10])
+    page.should have_content(milestone.expires_at)
+    page.should have_content("Browse Issues")
+  end
+
+  And 'project "Shop" has milestone "v2.2"' do
+    project = Project.find_by_name("Shop")
+    milestone = Factory :milestone, :title => "v2.2", :project => project
+
+    3.times { Factory :issue, :project => project, :milestone => milestone }
+  end
+end
diff --git a/features/steps/project/project_network_graph.rb b/features/steps/project/project_network_graph.rb
new file mode 100644 (file)
index 0000000..f34a81a
--- /dev/null
@@ -0,0 +1,22 @@
+class ProjectNetworkGraph < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+
+  Then 'page should have network graph' do
+    page.should have_content "Project Network Graph"
+    within ".graph" do
+      page.should have_content "master"
+      page.should have_content "scss_refactor..."
+    end
+  end
+
+  And 'I visit project "Shop" network page' do
+    project = Project.find_by_name("Shop")
+
+    # Stub out find_all to speed this up (10 commits vs. 650)
+    commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10})
+    Grit::Commit.stub(:find_all).and_return(commits)
+
+    visit graph_project_path(project)
+  end
+end
diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb
new file mode 100644 (file)
index 0000000..7beca25
--- /dev/null
@@ -0,0 +1,89 @@
+class ProjectTeamManagement < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedPaths
+
+  Then 'I should be able to see myself in team' do
+    page.should have_content(@user.name)
+    page.should have_content(@user.email)
+  end
+
+  And 'I should see "Sam" in team list' do
+    user = User.find_by_name("Sam")
+    page.should have_content(user.name)
+    page.should have_content(user.email)
+  end
+
+  Given 'I click link "New Team Member"' do
+    click_link "New Team Member"
+  end
+
+  And 'I select "Mike" as "Reporter"' do
+    user = User.find_by_name("Mike")
+    within "#new_team_member" do
+      select user.name, :from => "user_ids"
+      select "Reporter", :from => "project_access"
+    end
+    click_button "Save"
+  end
+
+  Then 'I should see "Mike" in team list as "Reporter"' do
+    user = User.find_by_name("Mike")
+    role_id = find(".user_#{user.id} #team_member_project_access").value
+    role_id.should == UsersProject.access_roles["Reporter"].to_s
+  end
+
+  Given 'I should see "Sam" in team list as "Developer"' do
+    user = User.find_by_name("Sam")
+    role_id = find(".user_#{user.id} #team_member_project_access").value
+    role_id.should == UsersProject.access_roles["Developer"].to_s
+  end
+
+  And 'I change "Sam" role to "Reporter"' do
+    user = User.find_by_name("Sam")
+    within ".user_#{user.id}" do
+      select "Reporter", :from => "team_member_project_access"
+    end
+  end
+
+  And 'I should see "Sam" in team list as "Reporter"' do
+    user = User.find_by_name("Sam")
+    role_id = find(".user_#{user.id} #team_member_project_access").value
+    role_id.should == UsersProject.access_roles["Reporter"].to_s
+  end
+
+  Given 'I click link "Sam"' do
+    click_link "Sam"
+  end
+
+  Then 'I should see "Sam" team profile' do
+    user = User.find_by_name("Sam")
+    page.should have_content(user.name)
+    page.should have_content(user.email)
+    page.should have_content("To team list")
+  end
+
+  And 'I click link "Remove from team"' do
+    click_link "Remove from team"
+  end
+
+  And 'I should not see "Sam" in team list' do
+    user = User.find_by_name("Sam")
+    page.should_not have_content(user.name)
+    page.should_not have_content(user.email)
+  end
+
+  And 'gitlab user "Mike"' do
+    Factory :user, :name => "Mike"
+  end
+
+  And 'gitlab user "Sam"' do
+    Factory :user, :name => "Sam"
+  end
+
+  And '"Sam" is "Shop" developer' do
+    user = User.find_by_name("Sam")
+    project = Project.find_by_name("Shop")
+    project.add_access(user, :write)
+  end
+end
diff --git a/features/steps/project/project_wall.rb b/features/steps/project/project_wall.rb
new file mode 100644 (file)
index 0000000..ba9d353
--- /dev/null
@@ -0,0 +1,6 @@
+class ProjectWall < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedNote
+  include SharedPaths
+end
diff --git a/features/steps/project/project_wiki.rb b/features/steps/project/project_wiki.rb
new file mode 100644 (file)
index 0000000..902e9ce
--- /dev/null
@@ -0,0 +1,20 @@
+class ProjectWiki < Spinach::FeatureSteps
+  include SharedAuthentication
+  include SharedProject
+  include SharedNote
+  include SharedPaths
+
+  Given 'I create Wiki page' do
+    fill_in "Title", :with => 'Test title'
+    fill_in "Content", :with => '[link test](test)'
+    click_on "Save"
+  end
+
+  Then 'I should see newly created wiki page' do
+    page.should have_content "Test title"
+    page.should have_content "link test"
+
+    click_link "link test"
+    page.should have_content "Editing page"
+  end
+end
diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb
new file mode 100644 (file)
index 0000000..77d9839
--- /dev/null
@@ -0,0 +1,10 @@
+require Rails.root.join('spec', 'support', 'login_helpers')
+
+module SharedAuthentication
+  include Spinach::DSL
+  include LoginHelpers
+
+  Given 'I sign in as a user' do
+    login_as :user
+  end
+end
diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb
new file mode 100644 (file)
index 0000000..923e69b
--- /dev/null
@@ -0,0 +1,21 @@
+module SharedNote
+  include Spinach::DSL
+
+  Given 'I leave a comment like "XML attached"' do
+    fill_in "note_note", :with => "XML attached"
+    click_button "Add Comment"
+  end
+
+  Then 'I should see comment "XML attached"' do
+    page.should have_content "XML attached"
+  end
+
+  Given 'I write new comment "my special test message"' do
+    fill_in "note_note", :with => "my special test message"
+    click_button "Add Comment"
+  end
+
+  Then 'I should see project wall note "my special test message"' do
+    page.should have_content "my special test message"
+  end
+end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
new file mode 100644 (file)
index 0000000..05ae88e
--- /dev/null
@@ -0,0 +1,112 @@
+module SharedPaths
+  include Spinach::DSL
+
+  And 'I visit dashboard search page' do
+    visit search_path
+  end
+
+  And 'I visit dashboard merge requests page' do
+    visit dashboard_merge_requests_path
+  end
+
+  And 'I visit dashboard issues page' do
+    visit dashboard_issues_path
+  end
+
+  When 'I visit dashboard page' do
+    visit dashboard_path
+  end
+
+  Given 'I visit profile page' do
+    visit profile_path
+  end
+
+  Given 'I visit profile password page' do
+    visit profile_password_path
+  end
+
+  Given 'I visit profile token page' do
+    visit profile_token_path
+  end
+
+  When 'I visit new project page' do
+    visit new_project_path
+  end
+
+  And 'I visit project "Shop" page' do
+    project = Project.find_by_name("Shop")
+    visit project_path(project)
+  end
+
+  Given 'I visit project branches page' do
+    visit branches_project_repository_path(@project)
+  end
+
+  Given 'I visit compare refs page' do
+    visit compare_project_commits_path(@project)
+  end
+
+  Given 'I visit project commits page' do
+    visit project_commits_path(@project)
+  end
+
+  Given 'I visit project source page' do
+    visit tree_project_ref_path(@project, @project.root_ref)
+  end
+
+  Given 'I visit blob file from repo' do
+    visit tree_project_ref_path(@project, ValidCommit::ID, :path => ValidCommit::BLOB_FILE_PATH)
+  end
+
+  Given 'I visit project source page for "8470d70"' do
+    visit tree_project_ref_path(@project, "8470d70")
+  end
+
+  Given 'I visit project tags page' do
+    visit tags_project_repository_path(@project)
+  end
+
+  Given 'I visit project commit page' do
+    visit project_commit_path(@project, ValidCommit::ID)
+  end
+
+  And 'I visit project "Shop" issues page' do
+    visit project_issues_path(Project.find_by_name("Shop"))
+  end
+
+  Given 'I visit issue page "Release 0.4"' do
+    issue = Issue.find_by_title("Release 0.4")
+    visit project_issue_path(issue.project, issue)
+  end
+
+  Given 'I visit project "Shop" labels page' do
+    visit project_labels_path(Project.find_by_name("Shop"))
+  end
+
+  Given 'I visit merge request page "Bug NS-04"' do
+    mr = MergeRequest.find_by_title("Bug NS-04")
+    visit project_merge_request_path(mr.project, mr)
+  end
+
+  And 'I visit project "Shop" merge requests page' do
+    visit project_merge_requests_path(Project.find_by_name("Shop"))
+  end
+
+  Given 'I visit project "Shop" milestones page' do
+    @project = Project.find_by_name("Shop")
+    visit project_milestones_path(@project)
+  end
+
+  Then 'I visit project "Shop" team page' do
+    visit team_project_path(Project.find_by_name("Shop"))
+  end
+
+  Then 'I visit project "Shop" wall page' do
+    project = Project.find_by_name("Shop")
+    visit wall_project_path(project)
+  end
+
+  Given 'I visit project wiki page' do
+    visit project_wiki_path(@project, :index)
+  end
+end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
new file mode 100644 (file)
index 0000000..9b64ca5
--- /dev/null
@@ -0,0 +1,8 @@
+module SharedProject
+  include Spinach::DSL
+
+  And 'I own project "Shop"' do
+    @project = Factory :project, :name => "Shop"
+    @project.add_access(@user, :admin)
+  end
+end
index 5357815..9c6cef0 100644 (file)
@@ -1,59 +1,27 @@
-unless ENV['CI']
-  require 'simplecov'
-  SimpleCov.start 'rails'
-end
-
-require 'cucumber/rails'
-require 'webmock/cucumber'
-
-WebMock.allow_net_connect!
-
-require Rails.root.join 'spec/support/gitolite_stub'
-require Rails.root.join 'spec/support/stubbed_repository'
-require Rails.root.join 'spec/support/login_helpers'
-require Rails.root.join 'spec/support/valid_commit'
+ENV['RAILS_ENV'] = 'test'
+require './config/environment'
 
-Capybara.default_selector = :css
-Capybara.javascript_driver = :webkit
+require 'rspec'
+require 'database_cleaner'
+require 'spinach/capybara'
 
-# By default, any exception happening in your Rails application will bubble up
-# to Cucumber so that your scenario will fail. This is a different from how
-# your application behaves in the production environment, where an error page will
-# be rendered instead.
-#
-# Sometimes we want to override this default behaviour and allow Rails to rescue
-# exceptions and display an error page (just like when the app is running in production).
-# Typical scenarios where you want to do this is when you test your error pages.
-# There are two ways to allow Rails to rescue exceptions:
-#
-# 1) Tag your scenario (or feature) with @allow-rescue
-#
-# 2) Set the value below to true. Beware that doing this globally is not
-# recommended as it will mask a lot of errors for you!
-#
-ActionController::Base.allow_rescue = false
-
-# Remove/comment out the lines below if your app doesn't have a database.
-# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
-begin
-  DatabaseCleaner.strategy = :transaction
-rescue NameError
-  raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
+%w(gitolite_stub stubbed_repository valid_commit).each do |f|
+  require Rails.root.join('spec', 'support', f)
 end
 
-Cucumber::Rails::Database.javascript_strategy = :truncation
+Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file}
 
-require 'headless'
+include GitoliteStub
 
-headless = Headless.new
-headless.start
+WebMock.allow_net_connect!
+Capybara.javascript_driver = :webkit
 
-require 'cucumber/rspec/doubles'
+DatabaseCleaner.strategy = :truncation
+Spinach.hooks.before_scenario { DatabaseCleaner.start }
+Spinach.hooks.after_scenario  { DatabaseCleaner.clean }
 
-include GitoliteStub
+Spinach.hooks.before_run do
+  RSpec::Mocks::setup self
 
-Before do
   stub_gitolite!
 end
-
-World(FactoryGirl::Syntax::Methods)
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
deleted file mode 100644 (file)
index 83f7947..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
-# It is recommended to regenerate this file in the future when you upgrade to a 
-# newer version of cucumber-rails. Consider adding your own code to a new file 
-# instead of editing this one. Cucumber will automatically load all features/**/*.rb
-# files.
-
-
-unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
-
-vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
-
-begin
-  require 'cucumber/rake/task'
-
-  namespace :cucumber do
-    Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
-      t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
-      t.fork = true # You may get faster startup if you set this to false
-      t.profile = 'default'
-    end
-
-    Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
-      t.binary = vendored_cucumber_bin
-      t.fork = true # You may get faster startup if you set this to false
-      t.profile = 'wip'
-    end
-
-    Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
-      t.binary = vendored_cucumber_bin
-      t.fork = true # You may get faster startup if you set this to false
-      t.profile = 'rerun'
-    end
-
-    desc 'Run all features'
-    task :all => [:ok, :wip]
-
-    task :statsetup do
-      require 'rails/code_statistics'
-      ::STATS_DIRECTORIES << %w(Cucumber\ features features) if File.exist?('features')
-      ::CodeStatistics::TEST_TYPES << "Cucumber features" if File.exist?('features')
-    end
-  end
-  desc 'Alias for cucumber:ok'
-  task :cucumber => 'cucumber:ok'
-
-  task :default => :cucumber
-
-  task :features => :cucumber do
-    STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
-  end
-
-  # In case we don't have ActiveRecord, append a no-op task that we can depend upon.
-  task 'db:test:prepare' do
-  end
-
-  task :stats => 'cucumber:statsetup'
-rescue LoadError
-  desc 'cucumber rake task not available (cucumber not installed)'
-  task :cucumber do
-    abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
-  end
-end
-
-end
index 77e148c..ad1bfb2 100644 (file)
@@ -1,5 +1,4 @@
 namespace :gitlab do
-  desc "GITLAB | Run both cucumber & rspec"
-  task :test => ['cucumber', 'spec']
+  desc "GITLAB | Run both spinach and rspec"
+  task :test => ['spinach', 'spec']
 end
-
index 58767e1..13e3213 100644 (file)
@@ -1,5 +1,5 @@
 task :travis do
-  ["cucumber", "rspec spec"].each do |cmd|
+  ["spinach", "rspec spec"].each do |cmd|
     puts "Starting to run #{cmd}..."
     system("export DISPLAY=:99.0 && bundle exec #{cmd}")
     raise "#{cmd} failed!" unless $?.exitstatus == 0
diff --git a/script/cucumber b/script/cucumber
deleted file mode 100755 (executable)
index 7fa5c92..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-
-vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
-if vendored_cucumber_bin
-  load File.expand_path(vendored_cucumber_bin)
-else
-  require 'rubygems' unless ENV['NO_RUBYGEMS']
-  require 'cucumber'
-  load Cucumber::BINARY
-end