Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update features for cucumber 0.10.2 and cucumber-rails 0.4.0

  • Loading branch information...
commit 868eab54cda299bd5082b522027328cbb8f240b0 1 parent a7c6c52
Ian White authored
44 Gemfile.lock.development
View
@@ -47,29 +47,31 @@ GEM
selenium-webdriver (>= 0.0.27)
xpath (~> 0.1.3)
celerity (0.8.8)
- childprocess (0.1.7)
- ffi (~> 0.6.3)
- cucumber (0.10.0)
+ childprocess (0.1.8)
+ ffi (~> 1.0.6)
+ cucumber (0.10.2)
builder (>= 2.1.2)
- diff-lcs (~> 1.1.2)
- gherkin (~> 2.3.2)
- json (~> 1.4.6)
- term-ansicolor (~> 1.0.5)
- cucumber-rails (0.3.2)
- cucumber (>= 0.8.0)
+ diff-lcs (>= 1.1.2)
+ gherkin (>= 2.3.5)
+ json (>= 1.4.6)
+ term-ansicolor (>= 1.0.5)
+ cucumber-rails (0.4.0)
+ cucumber (>= 0.10.1)
+ nokogiri (>= 1.4.4)
+ rack-test (>= 0.5.7)
culerity (0.2.15)
- database_cleaner (0.6.5)
+ database_cleaner (0.6.6)
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
factory_girl (1.3.3)
- ffi (0.6.3)
+ ffi (1.0.7)
rake (>= 0.8.7)
- gherkin (2.3.3)
- json (~> 1.4.6)
+ gherkin (2.3.5)
+ json (>= 1.4.6)
git (1.2.5)
i18n (0.5.0)
- json (1.4.6)
+ json (1.5.1)
json_pure (1.5.1)
machinist (1.0.6)
mail (2.2.15)
@@ -80,8 +82,8 @@ GEM
mime-types (1.16)
nokogiri (1.4.4)
polyglot (0.3.1)
- rack (1.2.1)
- rack-mount (0.6.13)
+ rack (1.2.2)
+ rack-mount (0.6.14)
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
@@ -114,9 +116,9 @@ GEM
railties (~> 3.0)
rspec (~> 2.5.0)
rubyzip (0.9.4)
- selenium-webdriver (0.1.3)
- childprocess (~> 0.1.5)
- ffi (~> 0.6.3)
+ selenium-webdriver (0.1.4)
+ childprocess (>= 0.1.7)
+ ffi (>= 1.0.7)
json_pure
rubyzip
sqlite3 (1.3.3)
@@ -126,10 +128,10 @@ GEM
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
- tzinfo (0.3.24)
+ tzinfo (0.3.25)
xpath (0.1.3)
nokogiri (~> 1.3)
- yard (0.6.4)
+ yard (0.6.5)
PLATFORMS
ruby
6 features/email/email.feature
View
@@ -40,21 +40,21 @@ Feature: I can test emails are sent
Scenario: Following the first link in an email
Given a user exists with name: "Fred", email: "fred@gmail.com"
- And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
+ And an email with a link "example page" to the user's page is delivered to fred@gmail.com
Then 1 email should be delivered to the user
And I click the first link in the email
Then I should be at the user's page
Scenario: Following a link in an email by url
Given a user exists with name: "Fred", email: "fred@gmail.com"
- And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
+ And an email with a link "example page" to the user's page is delivered to fred@gmail.com
Then 1 email should be delivered to the user
And I follow "example.com/" in the email
Then I should be at the user's page
Scenario: Following a link in an email by the text
Given a user exists with name: "Fred", email: "fred@gmail.com"
- And an email "cool" with body: "some text <a href='http://example.com/users/1'>example page</a> more text" is delivered to fred@gmail.com
+ And an email with a link "example page" to the user's page is delivered to fred@gmail.com
Then 1 email should be delivered to the user
And I follow "example page" in the email
Then I should be at the user's page
5 features/step_definitions/extra_email_steps.rb
View
@@ -2,6 +2,11 @@
Notifier.email(to, subject, body).deliver
end
+Given(/^an email with a link "(.+?)" to (.+?) is delivered to (.+?)$/) do |text, page, to|
+ body = "some text <a href='http://example.com/#{path_to(page)}'>#{text}</a> more text"
+ Notifier.email(to, "example", body).deliver
+end
+
Given(/^#{capture_model}'s email is delivered$/) do |model|
Notifier.user_email(model!(model)).deliver
end
51 features/support/env.rb
View
@@ -5,53 +5,10 @@
# files.
ENV["RAILS_ENV"] ||= "test"
-require File.expand_path(File.dirname(__FILE__) + '/../../cucumber_test_app/config/environment')
+ENV["RAILS_ROOT"] ||= File.expand_path(File.dirname(__FILE__) + '/../../cucumber_test_app')
-require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
-require 'cucumber/rails/world'
-require 'cucumber/rails/active_record'
-require 'cucumber/web/tableish'
-
-require 'capybara/rails'
-require 'capybara/cucumber'
-require 'capybara/session'
-require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
-# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
-# order to ease the transition to Capybara we set the default here. If you'd
-# prefer to use XPath just remove this line and adjust any selectors in your
-# steps to use the XPath syntax.
+require 'capybara'
+require 'cucumber/rails'
Capybara.default_selector = :css
-
-# If you set this to false, any error raised from within your app will bubble
-# up to your step definition and out to cucumber unless you catch it somewhere
-# on the way. You can make Rails rescue errors and render error pages on a
-# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
-#
-# If you set this to true, Rails will rescue all errors and render error
-# pages, more or less in the same way your application would behave in the
-# default production environment. It's not recommended to do this for all
-# of your scenarios, as this makes it hard to discover errors in your application.
ActionController::Base.allow_rescue = false
-
-# If you set this to true, each scenario will run in a database transaction.
-# You can still turn off transactions on a per-scenario basis, simply tagging
-# a feature or scenario with the @no-txn tag. If you are using Capybara,
-# tagging with @culerity or @javascript will also turn transactions off.
-#
-# If you set this to false, transactions will be off for all scenarios,
-# regardless of whether you use @no-txn or not.
-#
-# Beware that turning transactions off will leave data in your database
-# after each scenario, which can lead to hard-to-debug failures in
-# subsequent scenarios. If you do this, we recommend you create a Before
-# block that will explicitly put your database in a known state.
-Cucumber::Rails::World.use_transactional_fixtures = true
-# How to clean your database when transactions are turned off. See
-# http://github.com/bmabey/database_cleaner for more info.
-if defined?(ActiveRecord::Base)
- begin
- require 'database_cleaner'
- DatabaseCleaner.strategy = :truncation
- rescue LoadError => ignore_if_database_cleaner_not_present
- end
-end
+DatabaseCleaner.strategy = :truncation
Please sign in to comment.
Something went wrong with that request. Please try again.