cucumber-rails 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -1
- data/.travis.yml +1 -3
- data/Appraisals +52 -34
- data/CONTRIBUTING.md +13 -0
- data/Gemfile +0 -10
- data/History.md +10 -0
- data/LICENSE +2 -2
- data/README.md +16 -2
- data/cucumber-rails.gemspec +5 -5
- data/features/allow_rescue.feature +1 -2
- data/features/capybara_javascript_drivers.feature +3 -3
- data/features/choose_javascript_database_strategy.feature +5 -6
- data/features/database_cleaner.feature +1 -1
- data/features/disable_automatic_database_cleaning.feature +3 -3
- data/features/emulate_javascript.feature +2 -2
- data/features/install_cucumber_rails.feature +3 -3
- data/features/no_database.feature +2 -2
- data/features/raising_errors.feature +16 -0
- data/features/rerun_profile.feature +2 -3
- data/features/rest_api.feature +1 -1
- data/features/step_definitions/cucumber_rails_steps.rb +15 -7
- data/gemfiles/capybara_1_1.gemfile +9 -9
- data/gemfiles/rails_3_0.gemfile +8 -7
- data/gemfiles/rails_3_1.gemfile +9 -9
- data/gemfiles/rails_3_2.gemfile +9 -9
- data/gemfiles/rails_4_0.gemfile +20 -0
- metadata +46 -48
- data/features/fixing_bundler_pre.feature +0 -25
- data/features/mongoid.feature +0 -43
- data/features/multiple_databases.feature +0 -75
- data/features/routing.feature +0 -18
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
|
@@ -12,6 +12,7 @@ gemfile:
|
|
|
12
12
|
- gemfiles/rails_3_1.gemfile
|
|
13
13
|
- gemfiles/rails_3_2.gemfile
|
|
14
14
|
- gemfiles/capybara_1_1.gemfile
|
|
15
|
+
- gemfiles/rails_4_0.gemfile
|
|
15
16
|
|
|
16
17
|
matrix:
|
|
17
18
|
exclude:
|
|
@@ -22,9 +23,6 @@ matrix:
|
|
|
22
23
|
- rvm: 2.0.0
|
|
23
24
|
gemfile: gemfiles/capybara_1_1.gemfile
|
|
24
25
|
|
|
25
|
-
services:
|
|
26
|
-
- mongodb
|
|
27
|
-
|
|
28
26
|
# Needed for selenium browser
|
|
29
27
|
before_script:
|
|
30
28
|
- "export DISPLAY=:99.0"
|
data/Appraisals
CHANGED
|
@@ -1,53 +1,71 @@
|
|
|
1
1
|
appraise "rails_3_0" do
|
|
2
2
|
gem "rails", "~> 3.0.20"
|
|
3
3
|
gem "capybara", "~> 2.0.2"
|
|
4
|
-
gem "turn"
|
|
5
|
-
gem "rspec-rails"
|
|
6
|
-
gem
|
|
7
|
-
gem "uglifier"
|
|
8
|
-
gem
|
|
9
|
-
gem "bson_ext"
|
|
10
|
-
gem "mongoid"
|
|
4
|
+
gem "turn", "~> 0.9.6"
|
|
5
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
6
|
+
gem 'jquery-rails', "~> 2.2.1"
|
|
7
|
+
gem "uglifier", "~> 2.1.0"
|
|
8
|
+
gem 'sqlite3', "~> 1.3.7"
|
|
9
|
+
gem "bson_ext", "~> 1.8.5"
|
|
10
|
+
gem "mongoid", "~> 2.2.6"
|
|
11
|
+
gem 'database_cleaner', "~> 1.0.1"
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
appraise "rails_3_1" do
|
|
14
15
|
gem "rails", "~> 3.1.11"
|
|
15
16
|
gem "capybara", "~> 2.0.2"
|
|
16
|
-
gem 'turn'
|
|
17
|
-
gem
|
|
18
|
-
gem 'sass-rails'
|
|
19
|
-
gem 'coffee-rails'
|
|
20
|
-
gem '
|
|
21
|
-
gem
|
|
22
|
-
gem 'sqlite3'
|
|
23
|
-
gem
|
|
24
|
-
gem '
|
|
17
|
+
gem 'turn', "~> 0.9.6"
|
|
18
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
19
|
+
gem 'sass-rails', "~> 3.1.7"
|
|
20
|
+
gem 'coffee-rails', "~> 3.1.1"
|
|
21
|
+
gem 'jquery-rails', "~> 2.2.1"
|
|
22
|
+
gem "uglifier", "~> 2.1.0"
|
|
23
|
+
gem 'sqlite3', "~> 1.3.7"
|
|
24
|
+
gem "bson_ext", "~> 1.8.5"
|
|
25
|
+
gem 'database_cleaner', "~> 1.0.1"
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
appraise "rails_3_2" do
|
|
28
29
|
gem "rails", "~> 3.2.12"
|
|
29
30
|
gem "capybara", "~> 2.0.2"
|
|
30
|
-
gem 'turn'
|
|
31
|
-
gem
|
|
32
|
-
gem 'sass-rails'
|
|
33
|
-
gem 'coffee-rails'
|
|
34
|
-
gem '
|
|
35
|
-
gem
|
|
36
|
-
gem 'sqlite3'
|
|
37
|
-
gem
|
|
38
|
-
gem '
|
|
31
|
+
gem 'turn', "~> 0.9.6"
|
|
32
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
33
|
+
gem 'sass-rails', "~> 3.2.6"
|
|
34
|
+
gem 'coffee-rails', "~> 3.2.2"
|
|
35
|
+
gem 'jquery-rails', "~> 2.2.1"
|
|
36
|
+
gem "uglifier", "~> 2.1.0"
|
|
37
|
+
gem 'sqlite3', "~> 1.3.7"
|
|
38
|
+
gem "bson_ext", "~> 1.8.5"
|
|
39
|
+
gem 'database_cleaner', "~> 1.0.1"
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
appraise "capybara_1_1" do
|
|
42
43
|
gem "capybara", "~> 1.1.2"
|
|
43
44
|
gem "rails", "~> 3.2.12"
|
|
44
|
-
gem 'turn'
|
|
45
|
-
gem
|
|
46
|
-
gem 'sass-rails'
|
|
47
|
-
gem 'coffee-rails'
|
|
48
|
-
gem '
|
|
49
|
-
gem
|
|
50
|
-
gem 'sqlite3'
|
|
51
|
-
gem
|
|
52
|
-
gem '
|
|
45
|
+
gem 'turn', "~> 0.9.6"
|
|
46
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
47
|
+
gem 'sass-rails', "~> 3.2.6"
|
|
48
|
+
gem 'coffee-rails', "~> 3.2.2"
|
|
49
|
+
gem 'jquery-rails', "~> 2.2.1"
|
|
50
|
+
gem "uglifier", "~> 2.1.0"
|
|
51
|
+
gem 'sqlite3', "~> 1.3.7"
|
|
52
|
+
gem "bson_ext", "~> 1.8.5"
|
|
53
|
+
gem 'database_cleaner', "~> 1.0.1"
|
|
53
54
|
end
|
|
55
|
+
|
|
56
|
+
appraise "rails_4_0" do
|
|
57
|
+
gem "protected_attributes", "~> 1.0.3"
|
|
58
|
+
gem "rails", "~> 4.0.0"
|
|
59
|
+
gem "railties", "~> 4.0.0"
|
|
60
|
+
gem "capybara", "~> 2.0.2"
|
|
61
|
+
gem 'turn', "~> 0.9.6"
|
|
62
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
63
|
+
gem 'sass-rails', "~> 4.0.0"
|
|
64
|
+
gem 'coffee-rails', "~> 4.0.0"
|
|
65
|
+
gem 'jquery-rails', "~> 2.2.1"
|
|
66
|
+
gem "uglifier", "~> 2.1.0"
|
|
67
|
+
gem 'sqlite3', "~> 1.3.7"
|
|
68
|
+
gem "bson_ext", "~> 1.8.5"
|
|
69
|
+
gem 'mongoid', git: 'https://github.com/mongoid/mongoid.git'
|
|
70
|
+
gem 'database_cleaner', "~> 1.0.1"
|
|
71
|
+
end
|
data/CONTRIBUTING.md
CHANGED
|
@@ -43,6 +43,19 @@ Now release it
|
|
|
43
43
|
bundle exec rake
|
|
44
44
|
git commit -m "Release X.Y.Z"
|
|
45
45
|
rake release
|
|
46
|
+
|
|
47
|
+
### NOTE:
|
|
48
|
+
|
|
49
|
+
If after running the rake release task you get an eror similiar to this:
|
|
50
|
+
|
|
51
|
+
rake aborted!
|
|
52
|
+
Couldn't git push. `git push 2>&1' failed with the following output:
|
|
53
|
+
|
|
54
|
+
To git@github.com:cucumber/cucumber-rails.git
|
|
55
|
+
! [rejected] rails-2.3.x -> rails-2.3.x (non-fast-forward)
|
|
56
|
+
error: failed to push some refs to 'git@github.com:cucumber/cucumber-rails.git'
|
|
57
|
+
|
|
58
|
+
make sure that you have pulled all the recent changes from both the master and the rails-2.3.x branch
|
|
46
59
|
|
|
47
60
|
## Gaining Release Karma
|
|
48
61
|
|
data/Gemfile
CHANGED
|
@@ -3,15 +3,5 @@ source "https://rubygems.org"
|
|
|
3
3
|
# Test dependencies for Rails in the default test task, as test-generated
|
|
4
4
|
# apps do not run bundler for speed reasons. Kept here so they can be
|
|
5
5
|
# excluded from Appraisal-generated gemfiles.
|
|
6
|
-
gem 'rails', '~> 3.2.12'
|
|
7
|
-
gem 'turn'
|
|
8
|
-
gem 'rspec-rails'
|
|
9
|
-
gem 'sass-rails'
|
|
10
|
-
gem 'coffee-rails'
|
|
11
|
-
gem 'uglifier'
|
|
12
|
-
gem 'jquery-rails'
|
|
13
|
-
gem 'sqlite3'
|
|
14
|
-
gem 'bson_ext'
|
|
15
|
-
gem 'mongoid'
|
|
16
6
|
|
|
17
7
|
gemspec
|
data/History.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [v1.4.0](https://github.com/cucumber/cucumber-rails/compare/v1.3.1...v1.4.0) (2013-08-23)
|
|
2
|
+
|
|
3
|
+
### New Features
|
|
4
|
+
|
|
5
|
+
* Rails 4 compatibility
|
|
6
|
+
* Removal of unused tests (routing, multiple_databases, pre_bundler and mongo)
|
|
7
|
+
* New test raising_errors.feature to test raising routing errors that replaced the earlier routing.feature
|
|
8
|
+
* Added recommendation in README.md for running install scripts after upgrading (Joost Baaij)
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
## [v1.3.1](https://github.com/cucumber/cucumber-rails/compare/v1.3.0...v1.3.1) (2013-03-15)
|
|
2
12
|
|
|
3
13
|
### New Features
|
data/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2008,2009,2010,2011 Aslak Hellesøy and the Cucumber Team.
|
|
3
|
+
Copyright (c) 2008,2009,2010,2011,2012,2013 Aslak Hellesøy and the Cucumber Team.
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
|
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
19
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Cucumber-Rails
|
|
2
2
|
|
|
3
|
-
[](http://travis-ci.org/cucumber/cucumber-rails)
|
|
3
|
+
[](http://travis-ci.org/cucumber/cucumber-rails)
|
|
4
4
|
|
|
5
|
-
Cucumber-Rails brings Cucumber to Rails 3.x. For Rails 2.3.x support, see the [rails-2.3.x branch](https://github.com/cucumber/cucumber-rails/tree/rails-2.3.x).
|
|
5
|
+
Cucumber-Rails brings Cucumber to Rails 3.x and 4.x. For Rails 2.3.x support, see the [rails-2.3.x branch](https://github.com/cucumber/cucumber-rails/tree/rails-2.3.x).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -35,6 +35,20 @@ With Rake:
|
|
|
35
35
|
Without Rake:
|
|
36
36
|
|
|
37
37
|
[bundle exec] cucumber
|
|
38
|
+
|
|
39
|
+
## Configuration options
|
|
40
|
+
|
|
41
|
+
By default, cucumber-rails runs `DatabaseCleaner.start` and `DatabaseCleaner.clean` before and after your scenarios. You can disable this behaviour like so:
|
|
42
|
+
|
|
43
|
+
# features/support/env.rb
|
|
44
|
+
# ...
|
|
45
|
+
Cucumber::Rails::Database.autorun_database_cleaner = false
|
|
46
|
+
|
|
47
|
+
## Upgrading from a previous version
|
|
48
|
+
|
|
49
|
+
When upgrading from a previous version it is recommended that you rerun:
|
|
50
|
+
|
|
51
|
+
rails generate cucumber:install
|
|
38
52
|
|
|
39
53
|
## Bugs and feature requests
|
|
40
54
|
|
data/cucumber-rails.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = 'cucumber-rails'
|
|
6
|
-
s.version = '1.
|
|
6
|
+
s.version = '1.4.0'
|
|
7
7
|
s.authors = ["Aslak Hellesøy", "Dennis Blöte", "Rob Holland"]
|
|
8
8
|
s.description = "Cucumber Generator and Runtime for Rails"
|
|
9
9
|
s.summary = "#{s.name}-#{s.version}"
|
|
@@ -13,14 +13,14 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.add_runtime_dependency('cucumber', '>= 1.2.0')
|
|
14
14
|
s.add_runtime_dependency('nokogiri', '>= 1.5.0')
|
|
15
15
|
s.add_runtime_dependency('capybara', '>= 1.1.2')
|
|
16
|
-
s.add_runtime_dependency('rails', '
|
|
16
|
+
s.add_runtime_dependency('rails', '>= 3.0.0')
|
|
17
17
|
|
|
18
18
|
# Main development dependencies
|
|
19
19
|
s.add_development_dependency('rake', '>= 0.9.2.2')
|
|
20
|
-
s.add_development_dependency('bundler', '
|
|
20
|
+
s.add_development_dependency('bundler', '~> 1.3.5')
|
|
21
21
|
s.add_development_dependency('aruba', '>= 0.4.11')
|
|
22
|
-
s.add_development_dependency('rspec', '
|
|
23
|
-
s.add_development_dependency('ammeter', '>= 0.2.
|
|
22
|
+
s.add_development_dependency('rspec', '>= 2.2')
|
|
23
|
+
s.add_development_dependency('ammeter', '>= 0.2.9')
|
|
24
24
|
s.add_development_dependency('factory_girl', '>= 3.2.0')
|
|
25
25
|
s.add_development_dependency('database_cleaner', '>= 0.7.2')
|
|
26
26
|
s.add_development_dependency('appraisal', '~> 0.5.1')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Feature: Allow Cucumber to rescue exceptions
|
|
2
2
|
|
|
3
3
|
Background: A controller that raises an exception
|
|
4
|
-
Given I have created a new Rails
|
|
4
|
+
Given I have created a new Rails app "rails-3-app" and installed cucumber-rails
|
|
5
5
|
And I write to "app/controllers/posts_controller.rb" with:
|
|
6
6
|
"""
|
|
7
7
|
class PostsController < ApplicationController
|
|
@@ -59,4 +59,3 @@ Feature: Allow Cucumber to rescue exceptions
|
|
|
59
59
|
1 scenario (1 failed)
|
|
60
60
|
1 step (1 failed)
|
|
61
61
|
"""
|
|
62
|
-
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Feature: Capybara Javascript Drivers
|
|
3
3
|
|
|
4
4
|
Background: A simple calendar app
|
|
5
|
-
Given I have created a new Rails
|
|
5
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
6
6
|
And I successfully run `bundle exec rails g scaffold appointment name:string when:datetime`
|
|
7
7
|
And I write to "features/step_definitions/date_time_steps.rb" with:
|
|
8
8
|
"""
|
|
9
9
|
When /^(?:|I )select "([^"]+)" as the "([^"]+)" time$/ do |time, selector|
|
|
10
10
|
select_time(time, :from => selector)
|
|
11
11
|
end
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
When /^(?:|I )select "([^"]+)" as the "([^"]+)" date$/ do |date, selector|
|
|
14
14
|
select_date(date, :from => selector)
|
|
15
15
|
end
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
When /^(?:|I )select "([^"]+)" as the "([^"]+)" date and time$/ do |datetime, selector|
|
|
18
18
|
select_datetime(datetime, :from => selector)
|
|
19
19
|
end
|
|
@@ -24,7 +24,7 @@ Feature: Choose javascript database strategy
|
|
|
24
24
|
has been reported by some Oracle users.
|
|
25
25
|
|
|
26
26
|
Background:
|
|
27
|
-
Given I have created a new Rails
|
|
27
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
28
28
|
And I have a "Widget" ActiveRecord model object
|
|
29
29
|
|
|
30
30
|
Scenario: Set the strategy to truncation and run a javascript scenario.
|
|
@@ -64,7 +64,7 @@ Feature: Choose javascript database strategy
|
|
|
64
64
|
Widget.count.should == num.to_i
|
|
65
65
|
end
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Then /^the DatabaseCleaner strategy should be (\w+)$/ do |strategy_name|
|
|
68
68
|
DatabaseCleaner.connections.first.strategy.to_s.should =~ /#{strategy_name}/i
|
|
69
69
|
end
|
|
70
70
|
"""
|
|
@@ -75,7 +75,7 @@ Feature: Choose javascript database strategy
|
|
|
75
75
|
10 steps (10 passed)
|
|
76
76
|
"""
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
Scenario: Set the strategy to deletion and run a javascript scenario.
|
|
79
79
|
Given I append to "features/env.rb" with:
|
|
80
80
|
"""
|
|
81
81
|
Cucumber::Rails::Database.javascript_strategy = :deletion
|
|
@@ -113,7 +113,7 @@ Feature: Choose javascript database strategy
|
|
|
113
113
|
Scenario: Set the strategy to truncation with an except option and run a javascript scenario.
|
|
114
114
|
Given I append to "features/env.rb" with:
|
|
115
115
|
"""
|
|
116
|
-
|
|
116
|
+
Cucumber::Rails::Database.javascript_strategy = :truncation, {:except=>%w[widgets]}
|
|
117
117
|
"""
|
|
118
118
|
And I write to "features/widgets.feature" with:
|
|
119
119
|
"""
|
|
@@ -141,5 +141,4 @@ Feature: Choose javascript database strategy
|
|
|
141
141
|
"""
|
|
142
142
|
2 scenarios (2 passed)
|
|
143
143
|
3 steps (3 passed)
|
|
144
|
-
"""
|
|
145
|
-
|
|
144
|
+
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Feature: DatabaseCleaner
|
|
2
2
|
|
|
3
3
|
Scenario: Create records in background
|
|
4
|
-
Given I have created a new Rails
|
|
4
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
5
5
|
And I write to "features/widgets.feature" with:
|
|
6
6
|
"""
|
|
7
7
|
Feature: Create widgets
|
|
@@ -11,7 +11,7 @@ Feature: Disable automatic database cleaning
|
|
|
11
11
|
control the invocation of database_cleaner explicitly.
|
|
12
12
|
|
|
13
13
|
Scenario: Disabling automatic cleaning
|
|
14
|
-
Given I have created a new Rails
|
|
14
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
15
15
|
And I append to "features/env.rb" with:
|
|
16
16
|
"""
|
|
17
17
|
Cucumber::Rails::Database.autorun_database_cleaner = false
|
|
@@ -45,11 +45,11 @@ Feature: Disable automatic database cleaning
|
|
|
45
45
|
Then /^I should have (\d+) widgets$/ do |n|
|
|
46
46
|
Widget.count.should == n.to_i
|
|
47
47
|
end
|
|
48
|
-
|
|
48
|
+
"""
|
|
49
49
|
And I run `bundle exec rake db:migrate`
|
|
50
50
|
And I run `bundle exec rake cucumber`
|
|
51
51
|
Then it should pass with:
|
|
52
52
|
"""
|
|
53
53
|
2 scenarios (2 passed)
|
|
54
54
|
4 steps (4 passed)
|
|
55
|
-
"""
|
|
55
|
+
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Feature: Emulate Javascript
|
|
2
2
|
|
|
3
3
|
Scenario: See a widget
|
|
4
|
-
Given I have created a new Rails
|
|
4
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
5
5
|
And I successfully run `rails generate scaffold widget name:string`
|
|
6
6
|
And I write to "features/f.feature" with:
|
|
7
7
|
"""
|
|
@@ -35,7 +35,7 @@ Feature: Emulate Javascript
|
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
37
|
Scenario: Pass on the CSRF token
|
|
38
|
-
Given I have created a new Rails
|
|
38
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
39
39
|
And I successfully run `rails generate scaffold widget name:string`
|
|
40
40
|
And I successfully run `sed -i -e 's/forgery_protection *= false/forgery_protection = true/' config/environments/test.rb`
|
|
41
41
|
And I successfully run `rails generate controller session establish`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Feature: Rails
|
|
1
|
+
Feature: Rails
|
|
2
2
|
In order to take over the world
|
|
3
3
|
Cucumber-Rails should work on major versions
|
|
4
|
-
of Rails 3 and Ruby, with Capybara, Spork and DatabaseCleaner
|
|
4
|
+
of Rails 3 or 4 and Ruby, with Capybara, Spork and DatabaseCleaner
|
|
5
5
|
|
|
6
6
|
Scenario: Install Cucumber-Rails
|
|
7
|
-
Given I have created a new Rails
|
|
7
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
8
8
|
Then the following files should exist:
|
|
9
9
|
| config/cucumber.yml |
|
|
10
10
|
| script/cucumber |
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Feature: No Database
|
|
2
2
|
Allow Cucumber to work with a Rails app without a database
|
|
3
3
|
|
|
4
|
+
@fails-on-travis
|
|
4
5
|
Scenario: No ActiveRecord and DatabaseCleaner
|
|
5
|
-
Given I have created a new Rails
|
|
6
|
+
Given I have created a new Rails app with no database and installed cucumber-rails
|
|
6
7
|
# Turn off ActiveRecord
|
|
7
8
|
And I write to "config/application.rb" with:
|
|
8
9
|
"""
|
|
@@ -10,7 +11,6 @@ Feature: No Database
|
|
|
10
11
|
|
|
11
12
|
require 'action_controller/railtie'
|
|
12
13
|
require 'action_mailer/railtie'
|
|
13
|
-
require 'active_resource/railtie'
|
|
14
14
|
require 'rails/test_unit/railtie'
|
|
15
15
|
|
|
16
16
|
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Feature: Raise Errors
|
|
2
|
+
|
|
3
|
+
Scenario: Raise error for undefined route
|
|
4
|
+
Given I have created a new Rails app "test-app" with no database and installed cucumber-rails
|
|
5
|
+
And I write to "features/tests.feature" with:
|
|
6
|
+
"""
|
|
7
|
+
Feature: Tests
|
|
8
|
+
Scenario: Tests
|
|
9
|
+
When I go to the products page
|
|
10
|
+
"""
|
|
11
|
+
And I run `bundle exec cucumber`
|
|
12
|
+
Then it should fail with:
|
|
13
|
+
"""
|
|
14
|
+
1 scenario (1 failed)
|
|
15
|
+
1 step (1 failed)
|
|
16
|
+
"""
|
|
@@ -4,7 +4,7 @@ Feature: Rerun profile
|
|
|
4
4
|
I want to rerun only failing features
|
|
5
5
|
|
|
6
6
|
Scenario: Rerun
|
|
7
|
-
Given I have created a new Rails
|
|
7
|
+
Given I have created a new Rails app and installed cucumber-rails
|
|
8
8
|
And a file named "rerun.txt" with:
|
|
9
9
|
"""
|
|
10
10
|
features/rerun_test.feature:2
|
|
@@ -34,5 +34,4 @@ Feature: Rerun profile
|
|
|
34
34
|
1 scenario (1 passed)
|
|
35
35
|
1 step (1 passed)
|
|
36
36
|
"""
|
|
37
|
-
And the file "rerun.txt" should not contain "features/rerun_test.feature:2"
|
|
38
|
-
|
|
37
|
+
And the file "rerun.txt" should not contain "features/rerun_test.feature:2"
|
data/features/rest_api.feature
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Feature: REST API
|
|
2
2
|
|
|
3
3
|
Scenario: Compare JSON
|
|
4
|
-
Given I have created a new Rails
|
|
4
|
+
Given I have created a new Rails app "rails-3-app" and installed cucumber-rails
|
|
5
5
|
And I write to "app/controllers/posts_controller.rb" with:
|
|
6
6
|
"""
|
|
7
7
|
class PostsController < ApplicationController
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module CucumberRailsHelper
|
|
2
2
|
def rails_new(options={})
|
|
3
3
|
options[:name] ||= 'test_app'
|
|
4
|
-
run_simple "rails new #{options[:name]} --skip-
|
|
4
|
+
run_simple "bundle exec rails new #{options[:name]} --skip-test-unit #{options[:args]}"
|
|
5
5
|
assert_passing_with('README')
|
|
6
6
|
cd options[:name]
|
|
7
7
|
end
|
|
@@ -10,13 +10,14 @@ module CucumberRailsHelper
|
|
|
10
10
|
if options.include?(:not_in_test_group)
|
|
11
11
|
gem "cucumber-rails", :path => "#{File.expand_path('.')}"
|
|
12
12
|
else
|
|
13
|
-
gem "cucumber-rails", :group => :test, :path => "#{File.expand_path('.')}"
|
|
13
|
+
gem "cucumber-rails", :group => :test, :require => false, :path => "#{File.expand_path('.')}"
|
|
14
14
|
end
|
|
15
15
|
gem "capybara", :group => :test
|
|
16
16
|
gem "rspec-rails", :group => :test
|
|
17
17
|
gem "database_cleaner", :group => :test unless options.include?(:no_database_cleaner)
|
|
18
18
|
gem 'factory_girl', :group => :test unless options.include?(:no_factory_girl)
|
|
19
|
-
|
|
19
|
+
gem "selenium-webdriver", :group => :test
|
|
20
|
+
run_simple "bundle exec rails generate cucumber:install"
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def gem(name, options)
|
|
@@ -37,34 +38,41 @@ module CucumberRailsHelper
|
|
|
37
38
|
end
|
|
38
39
|
World(CucumberRailsHelper)
|
|
39
40
|
|
|
40
|
-
Given /^I have created a new Rails
|
|
41
|
+
Given /^I have created a new Rails app and installed cucumber\-rails, accidentally outside of the test group in my Gemfile$/ do
|
|
41
42
|
rails_new
|
|
42
43
|
install_cucumber_rails :not_in_test_group
|
|
43
44
|
create_web_steps
|
|
44
45
|
prepare_aruba_report
|
|
45
46
|
end
|
|
46
47
|
|
|
47
|
-
Given /^I have created a new Rails
|
|
48
|
+
Given /^I have created a new Rails app "([^"]*)" and installed cucumber\-rails$/ do |app_name|
|
|
48
49
|
rails_new :name => app_name
|
|
49
50
|
install_cucumber_rails
|
|
50
51
|
create_web_steps
|
|
51
52
|
prepare_aruba_report
|
|
52
53
|
end
|
|
53
54
|
|
|
54
|
-
Given /^I have created a new Rails
|
|
55
|
+
Given /^I have created a new Rails app and installed cucumber\-rails$/ do
|
|
55
56
|
rails_new
|
|
56
57
|
install_cucumber_rails
|
|
57
58
|
create_web_steps
|
|
58
59
|
prepare_aruba_report
|
|
59
60
|
end
|
|
60
61
|
|
|
61
|
-
Given /^I have created a new Rails
|
|
62
|
+
Given /^I have created a new Rails app with no database and installed cucumber-rails$/ do
|
|
62
63
|
rails_new :args => '--skip-active-record'
|
|
63
64
|
install_cucumber_rails :no_database_cleaner, :no_factory_girl
|
|
64
65
|
overwrite_file('features/support/env.rb', "require 'cucumber/rails'\n")
|
|
65
66
|
create_web_steps
|
|
66
67
|
end
|
|
67
68
|
|
|
69
|
+
Given /^I have created a new Rails app "(.*?)" with no database and installed cucumber\-rails$/ do |app_name|
|
|
70
|
+
rails_new :name => app_name, :args => '--skip-active-record'
|
|
71
|
+
install_cucumber_rails :no_database_cleaner, :no_factory_girl
|
|
72
|
+
overwrite_file('features/support/env.rb', "require 'cucumber/rails'\n")
|
|
73
|
+
create_web_steps
|
|
74
|
+
end
|
|
75
|
+
|
|
68
76
|
Given /^I have a "([^"]*)" ActiveRecord model object$/ do |name|
|
|
69
77
|
run_simple("bundle exec rails g model #{name}")
|
|
70
78
|
run_simple("bundle exec rake db:migrate RAILS_ENV=test")
|
|
@@ -4,14 +4,14 @@ source "https://rubygems.org"
|
|
|
4
4
|
|
|
5
5
|
gem "capybara", "~> 1.1.2"
|
|
6
6
|
gem "rails", "~> 3.2.12"
|
|
7
|
-
gem "turn"
|
|
8
|
-
gem "rspec-rails"
|
|
9
|
-
gem "sass-rails"
|
|
10
|
-
gem "coffee-rails"
|
|
11
|
-
gem "
|
|
12
|
-
gem "
|
|
13
|
-
gem "sqlite3"
|
|
14
|
-
gem "bson_ext"
|
|
15
|
-
gem "
|
|
7
|
+
gem "turn", "~> 0.9.6"
|
|
8
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
9
|
+
gem "sass-rails", "~> 3.2.6"
|
|
10
|
+
gem "coffee-rails", "~> 3.2.2"
|
|
11
|
+
gem "jquery-rails", "~> 2.2.1"
|
|
12
|
+
gem "uglifier", "~> 2.1.0"
|
|
13
|
+
gem "sqlite3", "~> 1.3.7"
|
|
14
|
+
gem "bson_ext", "~> 1.8.5"
|
|
15
|
+
gem "database_cleaner", "~> 1.0.1"
|
|
16
16
|
|
|
17
17
|
gemspec :path=>"../"
|
data/gemfiles/rails_3_0.gemfile
CHANGED
|
@@ -4,12 +4,13 @@ source "https://rubygems.org"
|
|
|
4
4
|
|
|
5
5
|
gem "rails", "~> 3.0.20"
|
|
6
6
|
gem "capybara", "~> 2.0.2"
|
|
7
|
-
gem "turn"
|
|
8
|
-
gem "rspec-rails"
|
|
9
|
-
gem "jquery-rails"
|
|
10
|
-
gem "uglifier"
|
|
11
|
-
gem "sqlite3"
|
|
12
|
-
gem "bson_ext"
|
|
13
|
-
gem "mongoid"
|
|
7
|
+
gem "turn", "~> 0.9.6"
|
|
8
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
9
|
+
gem "jquery-rails", "~> 2.2.1"
|
|
10
|
+
gem "uglifier", "~> 2.1.0"
|
|
11
|
+
gem "sqlite3", "~> 1.3.7"
|
|
12
|
+
gem "bson_ext", "~> 1.8.5"
|
|
13
|
+
gem "mongoid", "~> 2.2.6"
|
|
14
|
+
gem "database_cleaner", "~> 1.0.1"
|
|
14
15
|
|
|
15
16
|
gemspec :path=>"../"
|
data/gemfiles/rails_3_1.gemfile
CHANGED
|
@@ -4,14 +4,14 @@ source "https://rubygems.org"
|
|
|
4
4
|
|
|
5
5
|
gem "rails", "~> 3.1.11"
|
|
6
6
|
gem "capybara", "~> 2.0.2"
|
|
7
|
-
gem "turn"
|
|
8
|
-
gem "rspec-rails"
|
|
9
|
-
gem "sass-rails"
|
|
10
|
-
gem "coffee-rails"
|
|
11
|
-
gem "
|
|
12
|
-
gem "
|
|
13
|
-
gem "sqlite3"
|
|
14
|
-
gem "bson_ext"
|
|
15
|
-
gem "
|
|
7
|
+
gem "turn", "~> 0.9.6"
|
|
8
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
9
|
+
gem "sass-rails", "~> 3.1.7"
|
|
10
|
+
gem "coffee-rails", "~> 3.1.1"
|
|
11
|
+
gem "jquery-rails", "~> 2.2.1"
|
|
12
|
+
gem "uglifier", "~> 2.1.0"
|
|
13
|
+
gem "sqlite3", "~> 1.3.7"
|
|
14
|
+
gem "bson_ext", "~> 1.8.5"
|
|
15
|
+
gem "database_cleaner", "~> 1.0.1"
|
|
16
16
|
|
|
17
17
|
gemspec :path=>"../"
|
data/gemfiles/rails_3_2.gemfile
CHANGED
|
@@ -4,14 +4,14 @@ source "https://rubygems.org"
|
|
|
4
4
|
|
|
5
5
|
gem "rails", "~> 3.2.12"
|
|
6
6
|
gem "capybara", "~> 2.0.2"
|
|
7
|
-
gem "turn"
|
|
8
|
-
gem "rspec-rails"
|
|
9
|
-
gem "sass-rails"
|
|
10
|
-
gem "coffee-rails"
|
|
11
|
-
gem "
|
|
12
|
-
gem "
|
|
13
|
-
gem "sqlite3"
|
|
14
|
-
gem "bson_ext"
|
|
15
|
-
gem "
|
|
7
|
+
gem "turn", "~> 0.9.6"
|
|
8
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
9
|
+
gem "sass-rails", "~> 3.2.6"
|
|
10
|
+
gem "coffee-rails", "~> 3.2.2"
|
|
11
|
+
gem "jquery-rails", "~> 2.2.1"
|
|
12
|
+
gem "uglifier", "~> 2.1.0"
|
|
13
|
+
gem "sqlite3", "~> 1.3.7"
|
|
14
|
+
gem "bson_ext", "~> 1.8.5"
|
|
15
|
+
gem "database_cleaner", "~> 1.0.1"
|
|
16
16
|
|
|
17
17
|
gemspec :path=>"../"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "protected_attributes", "~> 1.0.3"
|
|
6
|
+
gem "rails", "~> 4.0.0"
|
|
7
|
+
gem "railties", "~> 4.0.0"
|
|
8
|
+
gem "capybara", "~> 2.0.2"
|
|
9
|
+
gem "turn", "~> 0.9.6"
|
|
10
|
+
gem "rspec-rails", "~> 2.12.2"
|
|
11
|
+
gem "sass-rails", "~> 4.0.0"
|
|
12
|
+
gem "coffee-rails", "~> 4.0.0"
|
|
13
|
+
gem "jquery-rails", "~> 2.2.1"
|
|
14
|
+
gem "uglifier", "~> 2.1.0"
|
|
15
|
+
gem "sqlite3", "~> 1.3.7"
|
|
16
|
+
gem "bson_ext", "~> 1.8.5"
|
|
17
|
+
gem "mongoid", :git=>"https://github.com/mongoid/mongoid.git"
|
|
18
|
+
gem "database_cleaner", "~> 1.0.1"
|
|
19
|
+
|
|
20
|
+
gemspec :path=>"../"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cucumber-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.4.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -11,11 +11,11 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2013-
|
|
14
|
+
date: 2013-08-23 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: cucumber
|
|
18
|
-
requirement: &
|
|
18
|
+
requirement: &22482920 !ruby/object:Gem::Requirement
|
|
19
19
|
none: false
|
|
20
20
|
requirements:
|
|
21
21
|
- - ! '>='
|
|
@@ -23,10 +23,10 @@ dependencies:
|
|
|
23
23
|
version: 1.2.0
|
|
24
24
|
type: :runtime
|
|
25
25
|
prerelease: false
|
|
26
|
-
version_requirements: *
|
|
26
|
+
version_requirements: *22482920
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: nokogiri
|
|
29
|
-
requirement: &
|
|
29
|
+
requirement: &22481680 !ruby/object:Gem::Requirement
|
|
30
30
|
none: false
|
|
31
31
|
requirements:
|
|
32
32
|
- - ! '>='
|
|
@@ -34,10 +34,10 @@ dependencies:
|
|
|
34
34
|
version: 1.5.0
|
|
35
35
|
type: :runtime
|
|
36
36
|
prerelease: false
|
|
37
|
-
version_requirements: *
|
|
37
|
+
version_requirements: *22481680
|
|
38
38
|
- !ruby/object:Gem::Dependency
|
|
39
39
|
name: capybara
|
|
40
|
-
requirement: &
|
|
40
|
+
requirement: &22498700 !ruby/object:Gem::Requirement
|
|
41
41
|
none: false
|
|
42
42
|
requirements:
|
|
43
43
|
- - ! '>='
|
|
@@ -45,21 +45,21 @@ dependencies:
|
|
|
45
45
|
version: 1.1.2
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
|
-
version_requirements: *
|
|
48
|
+
version_requirements: *22498700
|
|
49
49
|
- !ruby/object:Gem::Dependency
|
|
50
50
|
name: rails
|
|
51
|
-
requirement: &
|
|
51
|
+
requirement: &22498060 !ruby/object:Gem::Requirement
|
|
52
52
|
none: false
|
|
53
53
|
requirements:
|
|
54
|
-
- -
|
|
54
|
+
- - ! '>='
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
|
-
version:
|
|
56
|
+
version: 3.0.0
|
|
57
57
|
type: :runtime
|
|
58
58
|
prerelease: false
|
|
59
|
-
version_requirements: *
|
|
59
|
+
version_requirements: *22498060
|
|
60
60
|
- !ruby/object:Gem::Dependency
|
|
61
61
|
name: rake
|
|
62
|
-
requirement: &
|
|
62
|
+
requirement: &22497020 !ruby/object:Gem::Requirement
|
|
63
63
|
none: false
|
|
64
64
|
requirements:
|
|
65
65
|
- - ! '>='
|
|
@@ -67,21 +67,21 @@ dependencies:
|
|
|
67
67
|
version: 0.9.2.2
|
|
68
68
|
type: :development
|
|
69
69
|
prerelease: false
|
|
70
|
-
version_requirements: *
|
|
70
|
+
version_requirements: *22497020
|
|
71
71
|
- !ruby/object:Gem::Dependency
|
|
72
72
|
name: bundler
|
|
73
|
-
requirement: &
|
|
73
|
+
requirement: &22495880 !ruby/object:Gem::Requirement
|
|
74
74
|
none: false
|
|
75
75
|
requirements:
|
|
76
|
-
- -
|
|
76
|
+
- - ~>
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: 1.
|
|
78
|
+
version: 1.3.5
|
|
79
79
|
type: :development
|
|
80
80
|
prerelease: false
|
|
81
|
-
version_requirements: *
|
|
81
|
+
version_requirements: *22495880
|
|
82
82
|
- !ruby/object:Gem::Dependency
|
|
83
83
|
name: aruba
|
|
84
|
-
requirement: &
|
|
84
|
+
requirement: &22495340 !ruby/object:Gem::Requirement
|
|
85
85
|
none: false
|
|
86
86
|
requirements:
|
|
87
87
|
- - ! '>='
|
|
@@ -89,32 +89,32 @@ dependencies:
|
|
|
89
89
|
version: 0.4.11
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
|
-
version_requirements: *
|
|
92
|
+
version_requirements: *22495340
|
|
93
93
|
- !ruby/object:Gem::Dependency
|
|
94
94
|
name: rspec
|
|
95
|
-
requirement: &
|
|
95
|
+
requirement: &22494680 !ruby/object:Gem::Requirement
|
|
96
96
|
none: false
|
|
97
97
|
requirements:
|
|
98
|
-
- -
|
|
98
|
+
- - ! '>='
|
|
99
99
|
- !ruby/object:Gem::Version
|
|
100
|
-
version: 2.
|
|
100
|
+
version: '2.2'
|
|
101
101
|
type: :development
|
|
102
102
|
prerelease: false
|
|
103
|
-
version_requirements: *
|
|
103
|
+
version_requirements: *22494680
|
|
104
104
|
- !ruby/object:Gem::Dependency
|
|
105
105
|
name: ammeter
|
|
106
|
-
requirement: &
|
|
106
|
+
requirement: &22494040 !ruby/object:Gem::Requirement
|
|
107
107
|
none: false
|
|
108
108
|
requirements:
|
|
109
109
|
- - ! '>='
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: 0.2.
|
|
111
|
+
version: 0.2.9
|
|
112
112
|
type: :development
|
|
113
113
|
prerelease: false
|
|
114
|
-
version_requirements: *
|
|
114
|
+
version_requirements: *22494040
|
|
115
115
|
- !ruby/object:Gem::Dependency
|
|
116
116
|
name: factory_girl
|
|
117
|
-
requirement: &
|
|
117
|
+
requirement: &22493520 !ruby/object:Gem::Requirement
|
|
118
118
|
none: false
|
|
119
119
|
requirements:
|
|
120
120
|
- - ! '>='
|
|
@@ -122,10 +122,10 @@ dependencies:
|
|
|
122
122
|
version: 3.2.0
|
|
123
123
|
type: :development
|
|
124
124
|
prerelease: false
|
|
125
|
-
version_requirements: *
|
|
125
|
+
version_requirements: *22493520
|
|
126
126
|
- !ruby/object:Gem::Dependency
|
|
127
127
|
name: database_cleaner
|
|
128
|
-
requirement: &
|
|
128
|
+
requirement: &22492780 !ruby/object:Gem::Requirement
|
|
129
129
|
none: false
|
|
130
130
|
requirements:
|
|
131
131
|
- - ! '>='
|
|
@@ -133,10 +133,10 @@ dependencies:
|
|
|
133
133
|
version: 0.7.2
|
|
134
134
|
type: :development
|
|
135
135
|
prerelease: false
|
|
136
|
-
version_requirements: *
|
|
136
|
+
version_requirements: *22492780
|
|
137
137
|
- !ruby/object:Gem::Dependency
|
|
138
138
|
name: appraisal
|
|
139
|
-
requirement: &
|
|
139
|
+
requirement: &22492140 !ruby/object:Gem::Requirement
|
|
140
140
|
none: false
|
|
141
141
|
requirements:
|
|
142
142
|
- - ~>
|
|
@@ -144,10 +144,10 @@ dependencies:
|
|
|
144
144
|
version: 0.5.1
|
|
145
145
|
type: :development
|
|
146
146
|
prerelease: false
|
|
147
|
-
version_requirements: *
|
|
147
|
+
version_requirements: *22492140
|
|
148
148
|
- !ruby/object:Gem::Dependency
|
|
149
149
|
name: yard
|
|
150
|
-
requirement: &
|
|
150
|
+
requirement: &22491180 !ruby/object:Gem::Requirement
|
|
151
151
|
none: false
|
|
152
152
|
requirements:
|
|
153
153
|
- - ~>
|
|
@@ -155,10 +155,10 @@ dependencies:
|
|
|
155
155
|
version: 0.8.5.2
|
|
156
156
|
type: :development
|
|
157
157
|
prerelease: false
|
|
158
|
-
version_requirements: *
|
|
158
|
+
version_requirements: *22491180
|
|
159
159
|
- !ruby/object:Gem::Dependency
|
|
160
160
|
name: rdoc
|
|
161
|
-
requirement: &
|
|
161
|
+
requirement: &22508220 !ruby/object:Gem::Requirement
|
|
162
162
|
none: false
|
|
163
163
|
requirements:
|
|
164
164
|
- - ~>
|
|
@@ -166,10 +166,10 @@ dependencies:
|
|
|
166
166
|
version: 3.12.2
|
|
167
167
|
type: :development
|
|
168
168
|
prerelease: false
|
|
169
|
-
version_requirements: *
|
|
169
|
+
version_requirements: *22508220
|
|
170
170
|
- !ruby/object:Gem::Dependency
|
|
171
171
|
name: rdiscount
|
|
172
|
-
requirement: &
|
|
172
|
+
requirement: &22507480 !ruby/object:Gem::Requirement
|
|
173
173
|
none: false
|
|
174
174
|
requirements:
|
|
175
175
|
- - ~>
|
|
@@ -177,10 +177,10 @@ dependencies:
|
|
|
177
177
|
version: 2.0.7
|
|
178
178
|
type: :development
|
|
179
179
|
prerelease: false
|
|
180
|
-
version_requirements: *
|
|
180
|
+
version_requirements: *22507480
|
|
181
181
|
- !ruby/object:Gem::Dependency
|
|
182
182
|
name: bcat
|
|
183
|
-
requirement: &
|
|
183
|
+
requirement: &22506340 !ruby/object:Gem::Requirement
|
|
184
184
|
none: false
|
|
185
185
|
requirements:
|
|
186
186
|
- - ~>
|
|
@@ -188,7 +188,7 @@ dependencies:
|
|
|
188
188
|
version: 0.6.2
|
|
189
189
|
type: :development
|
|
190
190
|
prerelease: false
|
|
191
|
-
version_requirements: *
|
|
191
|
+
version_requirements: *22506340
|
|
192
192
|
description: Cucumber Generator and Runtime for Rails
|
|
193
193
|
email: cukes@googlegroups.com
|
|
194
194
|
executables: []
|
|
@@ -224,14 +224,11 @@ files:
|
|
|
224
224
|
- features/database_cleaner.feature
|
|
225
225
|
- features/disable_automatic_database_cleaning.feature
|
|
226
226
|
- features/emulate_javascript.feature
|
|
227
|
-
- features/fixing_bundler_pre.feature
|
|
228
227
|
- features/install_cucumber_rails.feature
|
|
229
|
-
- features/mongoid.feature
|
|
230
|
-
- features/multiple_databases.feature
|
|
231
228
|
- features/no_database.feature
|
|
229
|
+
- features/raising_errors.feature
|
|
232
230
|
- features/rerun_profile.feature
|
|
233
231
|
- features/rest_api.feature
|
|
234
|
-
- features/routing.feature
|
|
235
232
|
- features/step_definitions/cucumber_rails_steps.rb
|
|
236
233
|
- features/step_definitions/mongo_steps.rb
|
|
237
234
|
- features/support/bundler_pre_support.rb
|
|
@@ -243,6 +240,7 @@ files:
|
|
|
243
240
|
- gemfiles/rails_3_0.gemfile
|
|
244
241
|
- gemfiles/rails_3_1.gemfile
|
|
245
242
|
- gemfiles/rails_3_2.gemfile
|
|
243
|
+
- gemfiles/rails_4_0.gemfile
|
|
246
244
|
- lib/cucumber/rails.rb
|
|
247
245
|
- lib/cucumber/rails/action_controller.rb
|
|
248
246
|
- lib/cucumber/rails/application.rb
|
|
@@ -285,7 +283,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
285
283
|
version: '0'
|
|
286
284
|
segments:
|
|
287
285
|
- 0
|
|
288
|
-
hash: -
|
|
286
|
+
hash: -1668878615738535966
|
|
289
287
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
288
|
none: false
|
|
291
289
|
requirements:
|
|
@@ -294,12 +292,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
294
292
|
version: '0'
|
|
295
293
|
segments:
|
|
296
294
|
- 0
|
|
297
|
-
hash: -
|
|
295
|
+
hash: -1668878615738535966
|
|
298
296
|
requirements: []
|
|
299
297
|
rubyforge_project:
|
|
300
298
|
rubygems_version: 1.8.17
|
|
301
299
|
signing_key:
|
|
302
300
|
specification_version: 3
|
|
303
|
-
summary: cucumber-rails-1.
|
|
301
|
+
summary: cucumber-rails-1.4.0
|
|
304
302
|
test_files: []
|
|
305
303
|
has_rdoc:
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
Feature: Fixing Bundler Pre
|
|
2
|
-
In order to keep fix a problem with bundler and rails
|
|
3
|
-
As a user with cucumber-rails outside of test group in my Gemfile
|
|
4
|
-
I want run features without errors
|
|
5
|
-
|
|
6
|
-
@bundler-pre
|
|
7
|
-
Scenario: Install Cucumber-Rails with bundler prerelease
|
|
8
|
-
Given I have created a new Rails 3 app and installed cucumber-rails, accidentally outside of the test group in my Gemfile
|
|
9
|
-
And I successfully run `rake db:migrate`
|
|
10
|
-
And I write to "features/tests.feature" with:
|
|
11
|
-
"""
|
|
12
|
-
Feature: Tests
|
|
13
|
-
Scenario: Tests
|
|
14
|
-
When I go to the home page
|
|
15
|
-
"""
|
|
16
|
-
And I run `bundle exec rake cucumber`
|
|
17
|
-
Then it should pass with:
|
|
18
|
-
"""
|
|
19
|
-
1 scenario (1 passed)
|
|
20
|
-
1 step (1 passed)
|
|
21
|
-
"""
|
|
22
|
-
And the output should contain "WARNING:"
|
|
23
|
-
And the output should contain ":require => false"
|
|
24
|
-
|
|
25
|
-
|
data/features/mongoid.feature
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Feature: Mongoid
|
|
2
|
-
|
|
3
|
-
Background:
|
|
4
|
-
Given mongodb is running on my machine
|
|
5
|
-
|
|
6
|
-
Scenario: Keep Mongoid happy
|
|
7
|
-
Given I successfully run `rails new cuke-app -O`
|
|
8
|
-
And I cd to "cuke-app"
|
|
9
|
-
And I append to "Gemfile" with:
|
|
10
|
-
"""
|
|
11
|
-
gem "cucumber-rails", :group => :test, :path => '../../..'
|
|
12
|
-
gem "capybara", :group => :test
|
|
13
|
-
gem "database_cleaner", :group => :test
|
|
14
|
-
gem "mongoid", :group => :test
|
|
15
|
-
gem "bson_ext", :group => :test
|
|
16
|
-
|
|
17
|
-
"""
|
|
18
|
-
And I successfully run `bundle exec rails generate cucumber:install --skip-database`
|
|
19
|
-
And I successfully run `bundle exec rails generate mongoid:config`
|
|
20
|
-
And I write to "features/tests.feature" with:
|
|
21
|
-
"""
|
|
22
|
-
Feature: Tests
|
|
23
|
-
Scenario: Tests
|
|
24
|
-
When I go to the home page
|
|
25
|
-
"""
|
|
26
|
-
And I write to "features/step_definitions/web_steps.rb" with:
|
|
27
|
-
"""
|
|
28
|
-
When /^I go to the home page$/ do
|
|
29
|
-
visit '/'
|
|
30
|
-
end
|
|
31
|
-
"""
|
|
32
|
-
And I overwrite "features/support/env.rb" with:
|
|
33
|
-
"""
|
|
34
|
-
require 'cucumber/rails'
|
|
35
|
-
DatabaseCleaner.orm = 'mongoid'
|
|
36
|
-
DatabaseCleaner.strategy = :truncation
|
|
37
|
-
"""
|
|
38
|
-
And I run `bundle exec rake cucumber`
|
|
39
|
-
Then it should pass with:
|
|
40
|
-
"""
|
|
41
|
-
1 scenario (1 passed)
|
|
42
|
-
1 step (1 passed)
|
|
43
|
-
"""
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
Feature: Multiple Databases
|
|
2
|
-
In order to use Database Cleaner with multiple database repositories
|
|
3
|
-
As an engineer
|
|
4
|
-
I want to specify explicit strategies for each
|
|
5
|
-
|
|
6
|
-
Background: A Rails 3 app utilizing multiple database repositories exists
|
|
7
|
-
Given I have created a new Rails 3 app and installed cucumber-rails
|
|
8
|
-
And I append to "config/database.yml" with:
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
ursidae:
|
|
12
|
-
adapter: sqlite3
|
|
13
|
-
database: db/ursidae.sqlite3
|
|
14
|
-
"""
|
|
15
|
-
And I write to "app/models/bear.rb" with:
|
|
16
|
-
"""
|
|
17
|
-
class Bear < ActiveRecord::Base
|
|
18
|
-
establish_connection "ursidae"
|
|
19
|
-
|
|
20
|
-
attr_accessible :name
|
|
21
|
-
end
|
|
22
|
-
"""
|
|
23
|
-
And a directory named "db/migrate"
|
|
24
|
-
And I write to "db/migrate/001_create_bears.rb" with:
|
|
25
|
-
"""
|
|
26
|
-
class CreateBears < ActiveRecord::Migration
|
|
27
|
-
def self.up
|
|
28
|
-
if Rails.env == 'ursidae'
|
|
29
|
-
create_table :bears do |t|
|
|
30
|
-
t.string :name, :null => false
|
|
31
|
-
end
|
|
32
|
-
add_index :bears, :name, :unique => true
|
|
33
|
-
end
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
"""
|
|
37
|
-
And I successfully run `bundle exec rake db:migrate`
|
|
38
|
-
And I successfully run `bundle exec rake db:migrate RAILS_ENV=ursidae`
|
|
39
|
-
And I write to "features/support/env.rb" with:
|
|
40
|
-
"""
|
|
41
|
-
require 'cucumber/rails'
|
|
42
|
-
DatabaseCleaner.strategy = :transaction
|
|
43
|
-
DatabaseCleaner[:active_record, {:connection => "ursidae"}].strategy = :truncation
|
|
44
|
-
"""
|
|
45
|
-
And I write to "features/create_bear.feature" with:
|
|
46
|
-
"""
|
|
47
|
-
Feature: Screws up in transactional test and must use truncation
|
|
48
|
-
Scenario: I create a bear
|
|
49
|
-
When I create a bear
|
|
50
|
-
And something transactional happens
|
|
51
|
-
"""
|
|
52
|
-
And I write to "features/step_definitions/create_bear_steps.rb" with:
|
|
53
|
-
"""
|
|
54
|
-
When /^I create a bear$/ do
|
|
55
|
-
Bear.create!(:name => "yogi")
|
|
56
|
-
end
|
|
57
|
-
When /^something transactional happens$/ do
|
|
58
|
-
Bear.transaction { Bear.find_by_name("yogi").lock! }
|
|
59
|
-
end
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
Scenario: Default transactional strategy is not attempted on second database
|
|
63
|
-
When I run `bundle exec rake cucumber FEATURE=features/create_bear.feature`
|
|
64
|
-
Then it should pass with:
|
|
65
|
-
"""
|
|
66
|
-
1 scenario (1 passed)
|
|
67
|
-
2 steps (2 passed)
|
|
68
|
-
"""
|
|
69
|
-
And the output should not contain "cannot rollback - no transaction is active"
|
|
70
|
-
|
|
71
|
-
Scenario: Truncation strategy is used on the second database
|
|
72
|
-
Given I successfully run `bundle exec rails runner 'Bear.create(:name => "boo boo")'`
|
|
73
|
-
And I successfully run `bundle exec rake cucumber FEATURE=features/create_bear.feature`
|
|
74
|
-
When I run `bundle exec rails runner 'raise "ahh! bears!" if Bear.count > 0'`
|
|
75
|
-
Then the exit status should be 0
|
data/features/routing.feature
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Feature: Routing
|
|
2
|
-
|
|
3
|
-
Scenario: Visit undefined route
|
|
4
|
-
Given I have created a new Rails 3 app with no database and installed cucumber-rails
|
|
5
|
-
And I remove the file "public/index.html"
|
|
6
|
-
And I write to "features/tests.feature" with:
|
|
7
|
-
"""
|
|
8
|
-
Feature: Tests
|
|
9
|
-
Scenario: Tests
|
|
10
|
-
When I go to the home page
|
|
11
|
-
"""
|
|
12
|
-
And I run `rake cucumber`
|
|
13
|
-
Then it should fail with:
|
|
14
|
-
"""
|
|
15
|
-
1 scenario (1 failed)
|
|
16
|
-
1 step (1 failed)
|
|
17
|
-
"""
|
|
18
|
-
And the stdout should contain "ActionController::RoutingError"
|