Skip to content
This repository
Browse code

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
@@ -47,29 +47,31 @@ GEM
47 47 selenium-webdriver (>= 0.0.27)
48 48 xpath (~> 0.1.3)
49 49 celerity (0.8.8)
50   - childprocess (0.1.7)
51   - ffi (~> 0.6.3)
52   - cucumber (0.10.0)
  50 + childprocess (0.1.8)
  51 + ffi (~> 1.0.6)
  52 + cucumber (0.10.2)
53 53 builder (>= 2.1.2)
54   - diff-lcs (~> 1.1.2)
55   - gherkin (~> 2.3.2)
56   - json (~> 1.4.6)
57   - term-ansicolor (~> 1.0.5)
58   - cucumber-rails (0.3.2)
59   - cucumber (>= 0.8.0)
  54 + diff-lcs (>= 1.1.2)
  55 + gherkin (>= 2.3.5)
  56 + json (>= 1.4.6)
  57 + term-ansicolor (>= 1.0.5)
  58 + cucumber-rails (0.4.0)
  59 + cucumber (>= 0.10.1)
  60 + nokogiri (>= 1.4.4)
  61 + rack-test (>= 0.5.7)
60 62 culerity (0.2.15)
61   - database_cleaner (0.6.5)
  63 + database_cleaner (0.6.6)
62 64 diff-lcs (1.1.2)
63 65 erubis (2.6.6)
64 66 abstract (>= 1.0.0)
65 67 factory_girl (1.3.3)
66   - ffi (0.6.3)
  68 + ffi (1.0.7)
67 69 rake (>= 0.8.7)
68   - gherkin (2.3.3)
69   - json (~> 1.4.6)
  70 + gherkin (2.3.5)
  71 + json (>= 1.4.6)
70 72 git (1.2.5)
71 73 i18n (0.5.0)
72   - json (1.4.6)
  74 + json (1.5.1)
73 75 json_pure (1.5.1)
74 76 machinist (1.0.6)
75 77 mail (2.2.15)
@@ -80,8 +82,8 @@ GEM
80 82 mime-types (1.16)
81 83 nokogiri (1.4.4)
82 84 polyglot (0.3.1)
83   - rack (1.2.1)
84   - rack-mount (0.6.13)
  85 + rack (1.2.2)
  86 + rack-mount (0.6.14)
85 87 rack (>= 1.0.0)
86 88 rack-test (0.5.7)
87 89 rack (>= 1.0)
@@ -114,9 +116,9 @@ GEM
114 116 railties (~> 3.0)
115 117 rspec (~> 2.5.0)
116 118 rubyzip (0.9.4)
117   - selenium-webdriver (0.1.3)
118   - childprocess (~> 0.1.5)
119   - ffi (~> 0.6.3)
  119 + selenium-webdriver (0.1.4)
  120 + childprocess (>= 0.1.7)
  121 + ffi (>= 1.0.7)
120 122 json_pure
121 123 rubyzip
122 124 sqlite3 (1.3.3)
@@ -126,10 +128,10 @@ GEM
126 128 thor (0.14.6)
127 129 treetop (1.4.9)
128 130 polyglot (>= 0.3.1)
129   - tzinfo (0.3.24)
  131 + tzinfo (0.3.25)
130 132 xpath (0.1.3)
131 133 nokogiri (~> 1.3)
132   - yard (0.6.4)
  134 + yard (0.6.5)
133 135
134 136 PLATFORMS
135 137 ruby
6 features/email/email.feature
@@ -40,21 +40,21 @@ Feature: I can test emails are sent
40 40
41 41 Scenario: Following the first link in an email
42 42 Given a user exists with name: "Fred", email: "fred@gmail.com"
43   - 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
  43 + And an email with a link "example page" to the user's page is delivered to fred@gmail.com
44 44 Then 1 email should be delivered to the user
45 45 And I click the first link in the email
46 46 Then I should be at the user's page
47 47
48 48 Scenario: Following a link in an email by url
49 49 Given a user exists with name: "Fred", email: "fred@gmail.com"
50   - 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
  50 + And an email with a link "example page" to the user's page is delivered to fred@gmail.com
51 51 Then 1 email should be delivered to the user
52 52 And I follow "example.com/" in the email
53 53 Then I should be at the user's page
54 54
55 55 Scenario: Following a link in an email by the text
56 56 Given a user exists with name: "Fred", email: "fred@gmail.com"
57   - 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
  57 + And an email with a link "example page" to the user's page is delivered to fred@gmail.com
58 58 Then 1 email should be delivered to the user
59 59 And I follow "example page" in the email
60 60 Then I should be at the user's page
5 features/step_definitions/extra_email_steps.rb
@@ -2,6 +2,11 @@
2 2 Notifier.email(to, subject, body).deliver
3 3 end
4 4
  5 +Given(/^an email with a link "(.+?)" to (.+?) is delivered to (.+?)$/) do |text, page, to|
  6 + body = "some text <a href='http://example.com/#{path_to(page)}'>#{text}</a> more text"
  7 + Notifier.email(to, "example", body).deliver
  8 +end
  9 +
5 10 Given(/^#{capture_model}'s email is delivered$/) do |model|
6 11 Notifier.user_email(model!(model)).deliver
7 12 end
51 features/support/env.rb
@@ -5,53 +5,10 @@
5 5 # files.
6 6
7 7 ENV["RAILS_ENV"] ||= "test"
8   -require File.expand_path(File.dirname(__FILE__) + '/../../cucumber_test_app/config/environment')
  8 +ENV["RAILS_ROOT"] ||= File.expand_path(File.dirname(__FILE__) + '/../../cucumber_test_app')
9 9
10   -require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
11   -require 'cucumber/rails/world'
12   -require 'cucumber/rails/active_record'
13   -require 'cucumber/web/tableish'
14   -
15   -require 'capybara/rails'
16   -require 'capybara/cucumber'
17   -require 'capybara/session'
18   -require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
19   -# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
20   -# order to ease the transition to Capybara we set the default here. If you'd
21   -# prefer to use XPath just remove this line and adjust any selectors in your
22   -# steps to use the XPath syntax.
  10 +require 'capybara'
  11 +require 'cucumber/rails'
23 12 Capybara.default_selector = :css
24   -
25   -# If you set this to false, any error raised from within your app will bubble
26   -# up to your step definition and out to cucumber unless you catch it somewhere
27   -# on the way. You can make Rails rescue errors and render error pages on a
28   -# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
29   -#
30   -# If you set this to true, Rails will rescue all errors and render error
31   -# pages, more or less in the same way your application would behave in the
32   -# default production environment. It's not recommended to do this for all
33   -# of your scenarios, as this makes it hard to discover errors in your application.
34 13 ActionController::Base.allow_rescue = false
35   -
36   -# If you set this to true, each scenario will run in a database transaction.
37   -# You can still turn off transactions on a per-scenario basis, simply tagging
38   -# a feature or scenario with the @no-txn tag. If you are using Capybara,
39   -# tagging with @culerity or @javascript will also turn transactions off.
40   -#
41   -# If you set this to false, transactions will be off for all scenarios,
42   -# regardless of whether you use @no-txn or not.
43   -#
44   -# Beware that turning transactions off will leave data in your database
45   -# after each scenario, which can lead to hard-to-debug failures in
46   -# subsequent scenarios. If you do this, we recommend you create a Before
47   -# block that will explicitly put your database in a known state.
48   -Cucumber::Rails::World.use_transactional_fixtures = true
49   -# How to clean your database when transactions are turned off. See
50   -# http://github.com/bmabey/database_cleaner for more info.
51   -if defined?(ActiveRecord::Base)
52   - begin
53   - require 'database_cleaner'
54   - DatabaseCleaner.strategy = :truncation
55   - rescue LoadError => ignore_if_database_cleaner_not_present
56   - end
57   -end
  14 +DatabaseCleaner.strategy = :truncation

0 comments on commit 868eab5

Please sign in to comment.
Something went wrong with that request. Please try again.