Permalink
Browse files

Move to capybara/cucumber 1.0

  • Loading branch information...
nickrivadeneira committed Jul 23, 2011
1 parent 74cba17 commit 4d9db7b78ba6fb6bcf78aae7b1936dd22da4e9ac
Showing with 266 additions and 375 deletions.
  1. +8 −8 Gemfile
  2. +26 −19 Gemfile.lock
  3. +0 −1 app/controllers/application_controller.rb
  4. +1 −1 config/locales/en.yml
  5. +5 −5 features/edit_profile.feature
  6. +0 −1 features/email_reset.feature
  7. +0 −1 features/gravatar.feature
  8. +3 −4 features/homepage.feature
  9. +9 −8 features/owner.feature
  10. +1 −1 features/password_reset.feature
  11. +2 −2 features/push.feature
  12. +1 −3 features/rf_sign_in.feature
  13. +7 −10 features/sign_in.feature
  14. +7 −4 features/sign_up.feature
  15. +25 −36 features/step_definitions/api_steps.rb
  16. +6 −15 features/step_definitions/clearance_steps.rb
  17. +1 −1 features/step_definitions/dependency_steps.rb
  18. +2 −2 features/step_definitions/gravatar_steps.rb
  19. +1 −5 features/step_definitions/ssl_steps.rb
  20. +2 −2 features/step_definitions/user_steps.rb
  21. +11 −20 features/step_definitions/view_steps.rb
  22. +85 −155 features/step_definitions/web_steps.rb
  23. +9 −24 features/step_definitions/webhook_steps.rb
  24. +2 −2 features/support/api.rb
  25. +39 −44 features/support/env.rb
  26. +1 −1 features/support/gemcutter.rb
  27. +12 −0 lib/tasks/cucumber.rake
  28. BIN vendor/cache/bouncy-castle-java-1.5.0146.1.gem
  29. BIN vendor/cache/capybara-1.0.0.gem
  30. BIN vendor/cache/childprocess-0.2.0.gem
  31. BIN vendor/cache/cucumber-rails-0.3.2.gem
  32. BIN vendor/cache/cucumber-rails-1.0.2.gem
  33. BIN vendor/cache/ffi-1.0.9.gem
  34. BIN vendor/cache/jruby-openssl-0.7.4.gem
  35. BIN vendor/cache/json_pure-1.5.3.gem
  36. BIN vendor/cache/rubyzip-0.9.4.gem
  37. BIN vendor/cache/selenium-webdriver-0.2.2.gem
  38. BIN vendor/cache/spoon-0.0.1.gem
  39. BIN vendor/cache/xpath-0.1.4.gem
View
16 Gemfile
@@ -2,9 +2,9 @@ source 'http://rubygems.org'
gem 'rails', '~> 3.0.9'
-gem 'clearance', '~> 0.9.1'
+gem 'clearance', '~> 0.9.1'
gem 'fog'
-gem 'gchartrb', :require => 'google_chart'
+gem 'gchartrb', :require => 'google_chart'
gem 'gravtastic'
gem 'high_voltage'
gem 'hoptoad_notifier'
@@ -16,11 +16,11 @@ gem 'rack'
gem 'rack-maintenance', :require => 'rack/maintenance'
gem 'rdoc'
gem 'redis'
-gem 'rest-client', :require => 'rest_client'
+gem 'rest-client', :require => 'rest_client'
gem 'sinatra'
-gem 'will_paginate', '~> 3.0.pre2'
+gem 'will_paginate', '~> 3.0.pre2'
gem 'xml-simple'
-gem 'yajl-ruby', :require => 'yajl/json_gem'
+gem 'yajl-ruby', :require => 'yajl/json_gem'
platforms :ruby_18 do
gem 'system_timer'
@@ -41,15 +41,15 @@ group :development, :test do
end
group :test do
- gem 'cucumber-rails', '~> 0.3.2'
+ gem 'cucumber-rails', '~> 1.0.2'
gem 'database_cleaner'
gem 'factory_girl_rails'
gem 'launchy'
gem 'nokogiri'
- gem 'rack-test', :require => 'rack/test'
+ gem 'rack-test', :require => 'rack/test'
gem 'rr'
gem 'shoulda'
gem 'timecop'
gem 'webmock'
- gem 'webrat', '~> 0.5.3'
+ gem 'webrat', '~> 0.5.3'
end
View
@@ -30,8 +30,16 @@ GEM
activesupport (3.0.9)
addressable (2.2.6)
arel (2.0.10)
- bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
+ capybara (1.0.0)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 0.2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.2.0)
+ ffi (~> 1.0.6)
clearance (0.9.1)
rails (~> 3.0.0)
crack (0.1.8)
@@ -41,8 +49,10 @@ GEM
gherkin (~> 2.4.5)
json (>= 1.4.6)
term-ansicolor (>= 1.0.5)
- cucumber-rails (0.3.2)
- cucumber (>= 0.8.0)
+ cucumber-rails (1.0.2)
+ capybara (>= 1.0.0)
+ cucumber (~> 1.0.0)
+ nokogiri (>= 1.4.6)
daemons (1.1.4)
database_cleaner (0.6.7)
delayed_job (2.1.4)
@@ -56,7 +66,7 @@ GEM
factory_girl_rails (1.1.0)
factory_girl (~> 2.0.0)
railties (>= 3.0.0)
- ffi (1.0.9-java)
+ ffi (1.0.9)
fog (0.9.0)
builder
excon (~> 0.6.1)
@@ -71,24 +81,16 @@ GEM
gchartrb (0.8)
gherkin (2.4.5)
json (>= 1.4.6)
- gherkin (2.4.5-java)
- json (>= 1.4.6)
gravtastic (3.1.0)
high_voltage (1.0.0)
hoptoad_notifier (2.4.11)
activesupport
builder
i18n (0.5.0)
- jruby-openssl (0.7.4)
- bouncy-castle-java
json (1.5.3)
- json (1.5.3-java)
+ json_pure (1.5.3)
launchy (2.0.4)
addressable (~> 2.2.6)
- launchy (2.0.4-java)
- addressable (~> 2.2.6)
- ffi (~> 1.0.9)
- spoon (~> 0.0.1)
mail (2.2.19)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
@@ -100,7 +102,6 @@ GEM
net-ssh (2.1.4)
newrelic_rpm (3.1.0)
nokogiri (1.5.0)
- nokogiri (1.5.0-java)
paul_revere (0.2.0)
rails (~> 3.0.0)
pg (0.11.0)
@@ -133,12 +134,17 @@ GEM
mime-types (>= 1.16)
rr (1.0.3)
ruby-hmac (0.4.0)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.2.2)
+ childprocess (>= 0.1.9)
+ ffi (>= 1.0.7)
+ json_pure
+ rubyzip
shoulda (2.11.3)
silent-postgres (0.0.8)
sinatra (1.2.6)
rack (~> 1.1)
- tilt (< 2.0, >= 1.2.2)
- spoon (0.0.1)
+ tilt (>= 1.2.2, < 2.0)
system_timer (1.2.4)
term-ansicolor (1.0.6)
thor (0.14.6)
@@ -150,22 +156,23 @@ GEM
validates_url_format_of (0.1.0)
activerecord (>= 2.3.4)
webmock (1.6.4)
- addressable (> 2.2.5, ~> 2.2)
+ addressable (~> 2.2, > 2.2.5)
crack (>= 0.1.7)
webrat (0.5.3)
nokogiri (>= 1.2.0)
rack (>= 1.0)
will_paginate (3.0.pre2)
xml-simple (1.1.0)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
yajl-ruby (0.8.2)
PLATFORMS
- java
ruby
DEPENDENCIES
clearance (~> 0.9.1)
- cucumber-rails (~> 0.3.2)
+ cucumber-rails (~> 1.0.2)
database_cleaner
delayed_job
factory_girl_rails
@@ -3,7 +3,6 @@ class ApplicationController < ActionController::Base
include SimpleSSLRequirement
helper :announcements
- #include AnnouncementsHelper
protect_from_forgery :only => [:create, :update, :destroy]
View
@@ -61,7 +61,7 @@ en:
all_gems: "all gems"
dashboard: "dashboard"
sign_in: "sign in"
- sign_in: "sign up"
+ sign_up: "sign up"
sign_out: "sign out"
footer:
about: "About"
@@ -12,14 +12,14 @@ Feature: Edit Profile
And I am on my edit profile page
When I fill in "Handle" with "john_doe"
And I press "Update"
- Then I should see my new "Handle"
+ Then I should see "john_doe"
+ And I should not see "johndoe"
Scenario: Update with existing handle
- Given I have signed in with "janedoe@example.com/password"
- And my handle is "some_doe"
- And I sign out
+ Given the following user exists:
+ | email | handle |
+ | janedoe@example.com | some_doe |
And I have signed in with "johndoe@example.com/password"
- And my handle is "john_doe"
And I am on my edit profile page
When I fill in "Handle" with "some_doe"
And I press "Update"
@@ -36,6 +36,5 @@ Feature: Email reset
Scenario: User signs in after resetting and confirming email address
When I have reset my email address to "email@newperson.com"
And I follow the confirmation link sent to "email@newperson.com"
- And I return next time
And I sign in as "email@newperson.com/password"
Then I should not see "sign in"
@@ -4,7 +4,6 @@ Feature: Gravatar
Should be able see users' gravatars where relevant
Scenario: User is not signed in
- Given no user exists with an email of "email@person.com"
When I go to the homepage
Then I should not see my gravatar
@@ -19,7 +19,6 @@ Feature: Homepage
When I am on the homepage
Then I should see the following most recent downloads:
- | name | downloads |
- | fireworm-1.0.0 | 20 |
- | sandworm-2.0.0 | 10 |
- | sandworm-1.0.0 | 5 |
+ | fireworm-1.0.0 (20) |
+ | sandworm-2.0.0 (10) |
+ | sandworm-1.0.0 (5) |
View
@@ -4,11 +4,12 @@ Feature: Manage owners
Should be able to add and remove gem owners
Background:
- Given the following email confirmed users exist:
+ Given I am using HTTPS
+ And the following email confirmed users exist:
| email |
| original@owner.org |
| new@owner.org |
- Given the following rubygem exists:
+ And the following rubygem exists:
| name |
| OGem |
And the following ownership exists:
@@ -39,7 +40,7 @@ Feature: Manage owners
Given I sign in as "original@owner.org/password"
And I have an api key for "original@owner.org/password"
When I add the owner "other@owner.org" to the rubygem "OGem" with my api key
- Then I should see "Owner could not be found."
+ Then the response should contain "Owner could not be found."
Scenario: Gem owner removes an owner
Given I sign in as "original@owner.org/password"
@@ -56,7 +57,7 @@ Feature: Manage owners
Given I sign in as "original@owner.org/password"
And I have an api key for "original@owner.org/password"
When I remove the owner "new@owner.org" from the rubygem "OGem" with my api key
- Then I should see "Owner could not be found."
+ Then the response should contain "Owner could not be found."
Scenario: Gem owner removes himself when he is not the last owner
Given I sign in as "original@owner.org/password"
@@ -65,21 +66,21 @@ Feature: Manage owners
| user | rubygem |
| email: new@owner.org | name: OGem |
When I remove the owner "original@owner.org" from the rubygem "OGem" with my api key
- Then I should see "Owner removed successfully."
+ Then the response should contain "Owner removed successfully."
Scenario: Gem owner removes himself when he is the last owner
Given I sign in as "original@owner.org/password"
And I have an api key for "original@owner.org/password"
When I remove the owner "original@owner.org" from the rubygem "OGem" with my api key
- Then I should see "Unable to remove owner."
+ Then the response should contain "Unable to remove owner."
Scenario Outline: Attempt to manage a gem without the right permission
Given I am signed up and confirmed as "non@owner.org/password"
And I have an api key for "non@owner.org/password"
When I <action> with my api key
- Then I should see "You do not have permission to manage this gem."
+ Then the response should contain "You do not have permission to manage this gem."
- Examples:
+ Examples:
| action |
| list the owners of gem "OGem" |
| add the owner "new@owner.org" to the rubygem "OGem" |
@@ -4,7 +4,7 @@ Feature: Password reset
Should be able to reset it
Scenario: User is not signed up
- Given no user exists with an email of "email@person.com"
+ Given I am using HTTPS
When I request password reset link to be sent to "email@person.com"
Then I should see "Unknown email"
View
@@ -24,8 +24,8 @@ Feature: Push Gems
When I have a gem "PGem" with version "1.0.0" and summary "Second try"
And I push the gem "PGem-1.0.0.gem" with my api key
- Then I should see "Repushing of gem versions is not allowed."
- And I should see "Please use `gem yank` to remove bad gem releases."
+ Then the response should contain "Repushing of gem versions is not allowed."
+ And the response should contain "Please use `gem yank` to remove bad gem releases."
And I visit the gem page for "PGem"
And I should see "PGem"
And I should see "1.0.0"
@@ -17,10 +17,8 @@ Feature: RubyForge legacy sign in
And no RubyForge user exists with an email of "email@person.com"
Scenario: RubyForge user logs on with wrong password
- Given no user exists with an email of "email@person.com"
- And I have a RubyForge account with "email@person.com/rfpassword"
+ Given I have a RubyForge account with "email@person.com/rfpassword"
When I go to the sign in page
And I sign in as "email@person.com/badpassword"
Then I should see "Bad email or password"
And I should be signed out
- And no user exists with an email of "email@person.com"
View
@@ -3,33 +3,31 @@ Feature: Sign in
A user
Should be able to sign in
- Scenario: User is not signed up
+ Background:
Given I am using HTTPS
- And no user exists with an email of "email@person.com"
+
+ Scenario: User is not signed up
When I go to the sign in page
And I sign in as "email@person.com/password"
Then I should see "Bad email or password"
And I should be signed out
Scenario: User is not confirmed
- Given I am using HTTPS
- And I signed up with "email@person.com/password"
+ Given I signed up with "email@person.com/password"
When I go to the sign in page
And I sign in as "email@person.com/password"
Then I should see "User has not confirmed email"
And I should be signed out
Scenario: User enters wrong password
- Given I am using HTTPS
- And I am signed up and confirmed as "email@person.com/password"
+ Given I am signed up and confirmed as "email@person.com/password"
When I go to the sign in page
And I sign in as "email@person.com/wrongpassword"
Then I should see "Bad email or password"
And I should be signed out
Scenario: User signs in successfully with email
- Given I am using HTTPS
- And I am signed up and confirmed as "email@person.com/password"
+ Given I am signed up and confirmed as "email@person.com/password"
When I go to the sign in page
And I sign in as "email@person.com/password"
Then I should see "Signed in"
@@ -38,8 +36,7 @@ Feature: Sign in
Then I should be signed in
Scenario: User signs in successfully with handle
- Given I am using HTTPS
- And I am signed up and confirmed as "email@person.com/password"
+ Given I am signed up and confirmed as "email@person.com/password"
And my handle is "signinnow"
When I go to the sign in page
And I sign in as "signinnow/password"
Oops, something went wrong.

1 comment on commit 4d9db7b

@sferik

This comment has been minimized.

Show comment Hide comment
@sferik

sferik Jul 25, 2011

Member

It would be nice to use capybara in the functional tests as well, so we could remove the webrat test dependency.

Member

sferik commented on 4d9db7b Jul 25, 2011

It would be nice to use capybara in the functional tests as well, so we could remove the webrat test dependency.

Please sign in to comment.