cucumber-rails 1.2.0 → 1.2.1
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/.travis.yml +3 -1
- data/History.md +7 -0
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/cucumber-rails.gemspec +16 -15
- data/features/capybara_javascript_drivers.feature +2 -32
- data/features/choose_javascript_database_strategy.feature +46 -7
- data/lib/cucumber/rails/database.rb +39 -6
- data/lib/generators/cucumber/install/USAGE +1 -1
- data/spec/cucumber/rails/database_spec.rb +57 -0
- metadata +76 -67
- data/features/field_with_errors.feature +0 -70
- data/features/inspect_query_string.feature +0 -35
data/.travis.yml
CHANGED
data/History.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [v1.2.1](https://github.com/cucumber/cucumber-rails/compare/v1.2.0...v1.2.1)
|
2
|
+
|
3
|
+
### New features
|
4
|
+
|
5
|
+
* Allow ability to use deletion as a javascript database strategy ([#185](https://github.com/cucumber/cucumber-rails/pull/185) Thijs de Vries)
|
6
|
+
* Support custom JS strategies ([#184](https://github.com/cucumber/cucumber-rails/pull/184) Michael Pabst)
|
7
|
+
|
1
8
|
## [v1.2.0](https://github.com/cucumber/cucumber-rails/compare/v1.1.1...v1.2.0)
|
2
9
|
|
3
10
|
### Removed features
|
data/README.md
CHANGED
@@ -49,7 +49,7 @@ If you know how to fix the bug yourself, make a second commit (after committing
|
|
49
49
|
|
50
50
|
### Setting up your environment
|
51
51
|
|
52
|
-
I strongly recommend rvm and ruby 1.9.
|
52
|
+
I strongly recommend rvm and ruby 1.9.3. When you have that, cd into your cucumber-rails repository and:
|
53
53
|
|
54
54
|
gem install bundler
|
55
55
|
bundle install
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
CUCUMBER_RAILS_VERSION = Gem::Specification.load(File.dirname(__FILE__) + '/cucumber-rails.gemspec').version.version
|
3
3
|
require 'rubygems'
|
4
|
+
require 'rdoc' # https://github.com/lsegal/yard/commit/b861dcc2d7f7e1fbbed7b552ac2e4f7caf68bafa
|
4
5
|
require 'rake/clean'
|
5
6
|
require 'bundler'
|
6
7
|
Bundler::GemHelper.install_tasks
|
data/cucumber-rails.gemspec
CHANGED
@@ -3,38 +3,39 @@ $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.2.
|
6
|
+
s.version = '1.2.1'
|
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}"
|
10
10
|
s.email = 'cukes@googlegroups.com'
|
11
11
|
s.homepage = "http://cukes.info"
|
12
12
|
|
13
|
-
s.add_runtime_dependency('cucumber', '>= 1.1.
|
13
|
+
s.add_runtime_dependency('cucumber', '>= 1.1.3')
|
14
14
|
s.add_runtime_dependency('nokogiri', '>= 1.5.0')
|
15
|
-
s.add_runtime_dependency('capybara', '>= 1.1.
|
16
|
-
s.add_development_dependency('rails', '>= 3.1.
|
17
|
-
s.add_development_dependency('rake', '>= 0.9.2')
|
15
|
+
s.add_runtime_dependency('capybara', '>= 1.1.2')
|
16
|
+
s.add_development_dependency('rails', '>= 3.1.3')
|
17
|
+
s.add_development_dependency('rake', '>= 0.9.2.2')
|
18
18
|
s.add_development_dependency('bundler', '>= 1.0.21')
|
19
|
-
s.add_development_dependency('aruba', '>= 0.4.
|
20
|
-
s.add_development_dependency('sqlite3', '>= 1.3.
|
19
|
+
s.add_development_dependency('aruba', '>= 0.4.7')
|
20
|
+
s.add_development_dependency('sqlite3', '>= 1.3.5')
|
21
21
|
s.add_development_dependency('rspec', '>= 2.7.0')
|
22
22
|
s.add_development_dependency('rspec-rails', '>= 2.7.0')
|
23
23
|
s.add_development_dependency('ammeter', '>= 0.2.1')
|
24
|
-
s.add_development_dependency('factory_girl', '>= 2.2
|
25
|
-
s.add_development_dependency('database_cleaner', '>= 0.
|
26
|
-
s.add_development_dependency('mongoid', '>= 2.3.
|
27
|
-
s.add_development_dependency('bson_ext', '>= 1.
|
24
|
+
s.add_development_dependency('factory_girl', '>= 2.3.2')
|
25
|
+
s.add_development_dependency('database_cleaner', '>= 0.7.0')
|
26
|
+
s.add_development_dependency('mongoid', '>= 2.3.4')
|
27
|
+
s.add_development_dependency('bson_ext', '>= 1.5.1')
|
28
28
|
|
29
29
|
# Various Stuff that Rails 3.1 puts inside apps.
|
30
30
|
s.add_development_dependency('turn', '>= 0.8.3')
|
31
|
-
s.add_development_dependency('sass-rails', '>= 3.1.
|
31
|
+
s.add_development_dependency('sass-rails', '>= 3.1.5')
|
32
32
|
s.add_development_dependency('coffee-rails', '>= 3.1.1')
|
33
|
-
s.add_development_dependency('uglifier', '>= 1.0
|
34
|
-
s.add_development_dependency('jquery-rails', '>= 1.0.
|
33
|
+
s.add_development_dependency('uglifier', '>= 1.1.0')
|
34
|
+
s.add_development_dependency('jquery-rails', '>= 1.0.19')
|
35
35
|
|
36
36
|
# For Documentation:
|
37
|
-
s.add_development_dependency('yard', '~> 0.7.
|
37
|
+
s.add_development_dependency('yard', '~> 0.7.4')
|
38
|
+
s.add_development_dependency('rdoc', '~> 3.11')
|
38
39
|
s.add_development_dependency('rdiscount', '~> 1.6.8')
|
39
40
|
s.add_development_dependency('bcat', '~> 0.6.2')
|
40
41
|
|
@@ -18,7 +18,7 @@ Feature: Capybara Javascript Drivers
|
|
18
18
|
end
|
19
19
|
"""
|
20
20
|
|
21
|
-
Scenario
|
21
|
+
Scenario: Use a particular driver
|
22
22
|
Given I write to "features/create_appointment.feature" with:
|
23
23
|
"""
|
24
24
|
@javascript
|
@@ -32,17 +32,6 @@ Feature: Capybara Javascript Drivers
|
|
32
32
|
And I should see "2009-02-20 15:10:00 UTC"
|
33
33
|
|
34
34
|
"""
|
35
|
-
And I append to "Gemfile" with:
|
36
|
-
"""
|
37
|
-
<Gemfile extra>
|
38
|
-
|
39
|
-
"""
|
40
|
-
And I append to "features/support/env.rb" with:
|
41
|
-
"""
|
42
|
-
<env.rb extra>
|
43
|
-
|
44
|
-
"""
|
45
|
-
|
46
35
|
When I run `bundle exec rake db:migrate`
|
47
36
|
And I run `bundle exec rake cucumber`
|
48
37
|
Then it should pass with:
|
@@ -51,11 +40,7 @@ Feature: Capybara Javascript Drivers
|
|
51
40
|
6 steps (6 passed)
|
52
41
|
"""
|
53
42
|
|
54
|
-
|
55
|
-
| Gemfile extra | env.rb extra |
|
56
|
-
| '' | '' |
|
57
|
-
|
58
|
-
Scenario Outline: Mixed DB access
|
43
|
+
Scenario: Mixed DB access
|
59
44
|
Given I write to "features/create_appointment.feature" with:
|
60
45
|
"""
|
61
46
|
@javascript
|
@@ -76,16 +61,6 @@ Feature: Capybara Javascript Drivers
|
|
76
61
|
visit appointment_path(@appointment)
|
77
62
|
end
|
78
63
|
"""
|
79
|
-
And I append to "Gemfile" with:
|
80
|
-
"""
|
81
|
-
<Gemfile extra>
|
82
|
-
|
83
|
-
"""
|
84
|
-
And I append to "features/support/env.rb" with:
|
85
|
-
"""
|
86
|
-
<env.rb extra>
|
87
|
-
|
88
|
-
"""
|
89
64
|
|
90
65
|
When I run `bundle exec rake db:migrate`
|
91
66
|
And I run `bundle exec rake cucumber`
|
@@ -94,8 +69,3 @@ Feature: Capybara Javascript Drivers
|
|
94
69
|
1 scenario (1 passed)
|
95
70
|
3 steps (3 passed)
|
96
71
|
"""
|
97
|
-
|
98
|
-
Examples:
|
99
|
-
| Gemfile extra | env.rb extra |
|
100
|
-
| '' | '' |
|
101
|
-
|
@@ -1,9 +1,9 @@
|
|
1
1
|
@announce
|
2
2
|
Feature: Choose javascript database strategy
|
3
3
|
|
4
|
-
When running a scenario with the @javascript tag, Capybara will fire up a web server
|
4
|
+
When running a scenario with the @javascript tag, Capybara will fire up a web server
|
5
5
|
in the same process in a separate thread to your cukes. By default, this means ActiveRecord will give it a
|
6
|
-
separate database connection, which in turn means data you put into your database from
|
6
|
+
separate database connection, which in turn means data you put into your database from
|
7
7
|
Cucumber step definitions (e.g. using FactoryGirl) won't be visible to the web server
|
8
8
|
until the database transaction is committed.
|
9
9
|
|
@@ -18,20 +18,23 @@ Feature: Choose javascript database strategy
|
|
18
18
|
your database, but you run the risk of the two threads stomping on one another as they
|
19
19
|
talk to the database.
|
20
20
|
|
21
|
-
Right now, the default behavior which works for 80% of cucumber-rails users is to use
|
21
|
+
Right now, the default behavior which works for 80% of cucumber-rails users is to use
|
22
22
|
the shared connection patch, but you can override this by telling cucumber-rails which
|
23
23
|
strategy to use for javascript scenarios.
|
24
24
|
|
25
|
+
The deletion strategy can be quicker for situations where truncation causes locks which
|
26
|
+
has been reported by some Oracle users.
|
27
|
+
|
25
28
|
Background:
|
26
29
|
Given I have created a new Rails 3 app and installed cucumber-rails
|
27
30
|
And I have a "Widget" ActiveRecord model object
|
28
|
-
|
31
|
+
|
32
|
+
Scenario: Set the strategy to truncation and run a javascript scenario.
|
33
|
+
Given I append to "features/env.rb" with:
|
29
34
|
"""
|
30
35
|
Cucumber::Rails::Database.javascript_strategy = :truncation
|
31
36
|
"""
|
32
|
-
|
33
|
-
Scenario: Set the strategy to truncation and run a javascript scenario.
|
34
|
-
Given I write to "features/widgets.feature" with:
|
37
|
+
And I write to "features/widgets.feature" with:
|
35
38
|
"""
|
36
39
|
@javascript
|
37
40
|
Feature:
|
@@ -61,3 +64,39 @@ Feature: Choose javascript database strategy
|
|
61
64
|
2 scenarios (2 passed)
|
62
65
|
5 steps (5 passed)
|
63
66
|
"""
|
67
|
+
|
68
|
+
Scenario: Set the strategy to deletion and run a javascript scenario.
|
69
|
+
Given I append to "features/env.rb" with:
|
70
|
+
"""
|
71
|
+
Cucumber::Rails::Database.javascript_strategy = :deletion
|
72
|
+
"""
|
73
|
+
And I write to "features/widgets.feature" with:
|
74
|
+
"""
|
75
|
+
@javascript
|
76
|
+
Feature:
|
77
|
+
Background:
|
78
|
+
Given I have created 2 widgets
|
79
|
+
|
80
|
+
Scenario:
|
81
|
+
When I create 3 widgets
|
82
|
+
Then I should have 5 widgets
|
83
|
+
|
84
|
+
Scenario:
|
85
|
+
Then I should have 2 widgets
|
86
|
+
"""
|
87
|
+
And I write to "features/step_definitions/widget_steps.rb" with:
|
88
|
+
"""
|
89
|
+
Given /created? (\d) widgets/ do |num|
|
90
|
+
num.to_i.times { Widget.create! }
|
91
|
+
end
|
92
|
+
|
93
|
+
Then /should have (\d) widgets/ do |num|
|
94
|
+
Widget.count.should == num.to_i
|
95
|
+
end
|
96
|
+
"""
|
97
|
+
When I run the cukes
|
98
|
+
Then it should pass with:
|
99
|
+
"""
|
100
|
+
2 scenarios (2 passed)
|
101
|
+
5 steps (5 passed)
|
102
|
+
"""
|
@@ -1,11 +1,25 @@
|
|
1
1
|
module Cucumber
|
2
2
|
module Rails
|
3
3
|
module Database
|
4
|
+
|
5
|
+
CUSTOM_STRATEGY_INTERFACE = %w{ before_js before_non_js }
|
6
|
+
|
7
|
+
class InvalidStrategy < ArgumentError;end
|
8
|
+
|
4
9
|
class << self
|
5
10
|
|
6
11
|
def javascript_strategy=(strategy)
|
7
|
-
strategy_type =
|
12
|
+
strategy_type =
|
13
|
+
case strategy
|
14
|
+
when Symbol
|
15
|
+
map[strategy] || raise(InvalidStrategy, "The strategy '#{strategy}' is not understood. Please use one of #{map.keys.join(',')}")
|
16
|
+
when Class
|
17
|
+
strategy
|
18
|
+
end
|
19
|
+
|
8
20
|
@strategy = strategy_type.new
|
21
|
+
|
22
|
+
validate_interface!
|
9
23
|
end
|
10
24
|
|
11
25
|
def before_js
|
@@ -22,10 +36,17 @@ module Cucumber
|
|
22
36
|
{
|
23
37
|
:truncation => TruncationStrategy,
|
24
38
|
:shared_connection => SharedConnectionStrategy,
|
25
|
-
:transaction => SharedConnectionStrategy
|
39
|
+
:transaction => SharedConnectionStrategy,
|
40
|
+
:deletion => DeletionStrategy
|
26
41
|
}
|
27
42
|
end
|
28
43
|
|
44
|
+
def validate_interface!
|
45
|
+
unless CUSTOM_STRATEGY_INTERFACE.all? {|m| @strategy.respond_to?(m) }
|
46
|
+
raise(ArgumentError, "Strategy must respond to all of: #{CUSTOM_STRATEGY_INTERFACE.map{|method| "##{method}" } * ' '} !")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
29
50
|
end
|
30
51
|
|
31
52
|
class SharedConnectionStrategy
|
@@ -48,10 +69,10 @@ module Cucumber
|
|
48
69
|
end
|
49
70
|
end
|
50
71
|
|
51
|
-
class
|
52
|
-
def before_js
|
72
|
+
class Strategy
|
73
|
+
def before_js(strategy)
|
53
74
|
@original_strategy = DatabaseCleaner.connections.first.strategy # that feels like a nasty hack
|
54
|
-
DatabaseCleaner.strategy =
|
75
|
+
DatabaseCleaner.strategy = strategy
|
55
76
|
end
|
56
77
|
|
57
78
|
def before_non_js
|
@@ -61,7 +82,19 @@ module Cucumber
|
|
61
82
|
end
|
62
83
|
end
|
63
84
|
|
64
|
-
|
85
|
+
class TruncationStrategy < Strategy
|
86
|
+
def before_js
|
87
|
+
super :truncation
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
class DeletionStrategy < Strategy
|
92
|
+
def before_js
|
93
|
+
super :deletion
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
Database.javascript_strategy = :truncation
|
65
98
|
end
|
66
99
|
end
|
67
100
|
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require 'cucumber/rails/database'
|
3
|
+
|
4
|
+
describe Cucumber::Rails::Database do
|
5
|
+
|
6
|
+
let(:strategy) { stub(:before_js => nil, :before_non_js => nil) }
|
7
|
+
|
8
|
+
it 'forwards events to the selected strategy' do
|
9
|
+
Cucumber::Rails::Database::TruncationStrategy.stub(:new => strategy)
|
10
|
+
Cucumber::Rails::Database.javascript_strategy = :truncation
|
11
|
+
|
12
|
+
strategy.should_receive(:before_non_js).ordered
|
13
|
+
Cucumber::Rails::Database.before_non_js
|
14
|
+
|
15
|
+
strategy.should_receive(:before_js).ordered
|
16
|
+
Cucumber::Rails::Database.before_js
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'raises an error if you use a non-understood strategy' do
|
20
|
+
expect { Cucumber::Rails::Database.javascript_strategy = :invalid }.to raise_error(Cucumber::Rails::Database::InvalidStrategy)
|
21
|
+
end
|
22
|
+
|
23
|
+
describe 'using a custom strategy' do
|
24
|
+
class ValidStrategy
|
25
|
+
def before_js
|
26
|
+
# Anything
|
27
|
+
end
|
28
|
+
|
29
|
+
def before_non_js
|
30
|
+
# Likewise
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class InvalidStrategy
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'raises an error if the strategy doens\'t support the protocol' do
|
38
|
+
expect { Cucumber::Rails::Database.javascript_strategy = InvalidStrategy }.to raise_error(ArgumentError)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'accepts a custom strategy with a valid interface' do
|
42
|
+
expect { Cucumber::Rails::Database.javascript_strategy = ValidStrategy }.not_to raise_error
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'forwards events to a custom strategy' do
|
46
|
+
ValidStrategy.stub(:new => strategy)
|
47
|
+
Cucumber::Rails::Database.javascript_strategy = ValidStrategy
|
48
|
+
|
49
|
+
strategy.should_receive(:before_non_js).ordered
|
50
|
+
Cucumber::Rails::Database.before_non_js
|
51
|
+
|
52
|
+
strategy.should_receive(:before_js).ordered
|
53
|
+
Cucumber::Rails::Database.before_js
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
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.2.
|
4
|
+
version: 1.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,22 +11,22 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-12-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: cucumber
|
18
|
-
requirement: &
|
18
|
+
requirement: &2153136380 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 1.1.
|
23
|
+
version: 1.1.3
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2153136380
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
|
-
requirement: &
|
29
|
+
requirement: &2153135740 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,43 +34,43 @@ dependencies:
|
|
34
34
|
version: 1.5.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2153135740
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: capybara
|
40
|
-
requirement: &
|
40
|
+
requirement: &2153135020 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.1.
|
45
|
+
version: 1.1.2
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *2153135020
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: rails
|
51
|
-
requirement: &
|
51
|
+
requirement: &2153133620 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.1.
|
56
|
+
version: 3.1.3
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *2153133620
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rake
|
62
|
-
requirement: &
|
62
|
+
requirement: &2153133160 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.9.2
|
67
|
+
version: 0.9.2.2
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *2153133160
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: bundler
|
73
|
-
requirement: &
|
73
|
+
requirement: &2153132680 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,32 +78,32 @@ dependencies:
|
|
78
78
|
version: 1.0.21
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *2153132680
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: aruba
|
84
|
-
requirement: &
|
84
|
+
requirement: &2153132000 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.4.
|
89
|
+
version: 0.4.7
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *2153132000
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: sqlite3
|
95
|
-
requirement: &
|
95
|
+
requirement: &2153131280 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: 1.3.
|
100
|
+
version: 1.3.5
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *2153131280
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: rspec
|
106
|
-
requirement: &
|
106
|
+
requirement: &2153130560 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ! '>='
|
@@ -111,10 +111,10 @@ dependencies:
|
|
111
111
|
version: 2.7.0
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *2153130560
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: rspec-rails
|
117
|
-
requirement: &
|
117
|
+
requirement: &2153130060 !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
120
120
|
- - ! '>='
|
@@ -122,10 +122,10 @@ dependencies:
|
|
122
122
|
version: 2.7.0
|
123
123
|
type: :development
|
124
124
|
prerelease: false
|
125
|
-
version_requirements: *
|
125
|
+
version_requirements: *2153130060
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
127
|
name: ammeter
|
128
|
-
requirement: &
|
128
|
+
requirement: &2153129440 !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
131
131
|
- - ! '>='
|
@@ -133,54 +133,54 @@ dependencies:
|
|
133
133
|
version: 0.2.1
|
134
134
|
type: :development
|
135
135
|
prerelease: false
|
136
|
-
version_requirements: *
|
136
|
+
version_requirements: *2153129440
|
137
137
|
- !ruby/object:Gem::Dependency
|
138
138
|
name: factory_girl
|
139
|
-
requirement: &
|
139
|
+
requirement: &2153128480 !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
141
141
|
requirements:
|
142
142
|
- - ! '>='
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: 2.2
|
144
|
+
version: 2.3.2
|
145
145
|
type: :development
|
146
146
|
prerelease: false
|
147
|
-
version_requirements: *
|
147
|
+
version_requirements: *2153128480
|
148
148
|
- !ruby/object:Gem::Dependency
|
149
149
|
name: database_cleaner
|
150
|
-
requirement: &
|
150
|
+
requirement: &2153117380 !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
153
153
|
- - ! '>='
|
154
154
|
- !ruby/object:Gem::Version
|
155
|
-
version: 0.
|
155
|
+
version: 0.7.0
|
156
156
|
type: :development
|
157
157
|
prerelease: false
|
158
|
-
version_requirements: *
|
158
|
+
version_requirements: *2153117380
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: mongoid
|
161
|
-
requirement: &
|
161
|
+
requirement: &2153116500 !ruby/object:Gem::Requirement
|
162
162
|
none: false
|
163
163
|
requirements:
|
164
164
|
- - ! '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 2.3.
|
166
|
+
version: 2.3.4
|
167
167
|
type: :development
|
168
168
|
prerelease: false
|
169
|
-
version_requirements: *
|
169
|
+
version_requirements: *2153116500
|
170
170
|
- !ruby/object:Gem::Dependency
|
171
171
|
name: bson_ext
|
172
|
-
requirement: &
|
172
|
+
requirement: &2153115340 !ruby/object:Gem::Requirement
|
173
173
|
none: false
|
174
174
|
requirements:
|
175
175
|
- - ! '>='
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version: 1.
|
177
|
+
version: 1.5.1
|
178
178
|
type: :development
|
179
179
|
prerelease: false
|
180
|
-
version_requirements: *
|
180
|
+
version_requirements: *2153115340
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: turn
|
183
|
-
requirement: &
|
183
|
+
requirement: &2153113540 !ruby/object:Gem::Requirement
|
184
184
|
none: false
|
185
185
|
requirements:
|
186
186
|
- - ! '>='
|
@@ -188,21 +188,21 @@ dependencies:
|
|
188
188
|
version: 0.8.3
|
189
189
|
type: :development
|
190
190
|
prerelease: false
|
191
|
-
version_requirements: *
|
191
|
+
version_requirements: *2153113540
|
192
192
|
- !ruby/object:Gem::Dependency
|
193
193
|
name: sass-rails
|
194
|
-
requirement: &
|
194
|
+
requirement: &2153112700 !ruby/object:Gem::Requirement
|
195
195
|
none: false
|
196
196
|
requirements:
|
197
197
|
- - ! '>='
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version: 3.1.
|
199
|
+
version: 3.1.5
|
200
200
|
type: :development
|
201
201
|
prerelease: false
|
202
|
-
version_requirements: *
|
202
|
+
version_requirements: *2153112700
|
203
203
|
- !ruby/object:Gem::Dependency
|
204
204
|
name: coffee-rails
|
205
|
-
requirement: &
|
205
|
+
requirement: &2153112120 !ruby/object:Gem::Requirement
|
206
206
|
none: false
|
207
207
|
requirements:
|
208
208
|
- - ! '>='
|
@@ -210,43 +210,54 @@ dependencies:
|
|
210
210
|
version: 3.1.1
|
211
211
|
type: :development
|
212
212
|
prerelease: false
|
213
|
-
version_requirements: *
|
213
|
+
version_requirements: *2153112120
|
214
214
|
- !ruby/object:Gem::Dependency
|
215
215
|
name: uglifier
|
216
|
-
requirement: &
|
216
|
+
requirement: &2153111480 !ruby/object:Gem::Requirement
|
217
217
|
none: false
|
218
218
|
requirements:
|
219
219
|
- - ! '>='
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: 1.0
|
221
|
+
version: 1.1.0
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
|
-
version_requirements: *
|
224
|
+
version_requirements: *2153111480
|
225
225
|
- !ruby/object:Gem::Dependency
|
226
226
|
name: jquery-rails
|
227
|
-
requirement: &
|
227
|
+
requirement: &2153110640 !ruby/object:Gem::Requirement
|
228
228
|
none: false
|
229
229
|
requirements:
|
230
230
|
- - ! '>='
|
231
231
|
- !ruby/object:Gem::Version
|
232
|
-
version: 1.0.
|
232
|
+
version: 1.0.19
|
233
233
|
type: :development
|
234
234
|
prerelease: false
|
235
|
-
version_requirements: *
|
235
|
+
version_requirements: *2153110640
|
236
236
|
- !ruby/object:Gem::Dependency
|
237
237
|
name: yard
|
238
|
-
requirement: &
|
238
|
+
requirement: &2153109940 !ruby/object:Gem::Requirement
|
239
|
+
none: false
|
240
|
+
requirements:
|
241
|
+
- - ~>
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: 0.7.4
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: *2153109940
|
247
|
+
- !ruby/object:Gem::Dependency
|
248
|
+
name: rdoc
|
249
|
+
requirement: &2153109400 !ruby/object:Gem::Requirement
|
239
250
|
none: false
|
240
251
|
requirements:
|
241
252
|
- - ~>
|
242
253
|
- !ruby/object:Gem::Version
|
243
|
-
version:
|
254
|
+
version: '3.11'
|
244
255
|
type: :development
|
245
256
|
prerelease: false
|
246
|
-
version_requirements: *
|
257
|
+
version_requirements: *2153109400
|
247
258
|
- !ruby/object:Gem::Dependency
|
248
259
|
name: rdiscount
|
249
|
-
requirement: &
|
260
|
+
requirement: &2153108940 !ruby/object:Gem::Requirement
|
250
261
|
none: false
|
251
262
|
requirements:
|
252
263
|
- - ~>
|
@@ -254,10 +265,10 @@ dependencies:
|
|
254
265
|
version: 1.6.8
|
255
266
|
type: :development
|
256
267
|
prerelease: false
|
257
|
-
version_requirements: *
|
268
|
+
version_requirements: *2153108940
|
258
269
|
- !ruby/object:Gem::Dependency
|
259
270
|
name: bcat
|
260
|
-
requirement: &
|
271
|
+
requirement: &2153108360 !ruby/object:Gem::Requirement
|
261
272
|
none: false
|
262
273
|
requirements:
|
263
274
|
- - ~>
|
@@ -265,7 +276,7 @@ dependencies:
|
|
265
276
|
version: 0.6.2
|
266
277
|
type: :development
|
267
278
|
prerelease: false
|
268
|
-
version_requirements: *
|
279
|
+
version_requirements: *2153108360
|
269
280
|
description: Cucumber Generator and Runtime for Rails
|
270
281
|
email: cukes@googlegroups.com
|
271
282
|
executables: []
|
@@ -297,9 +308,7 @@ files:
|
|
297
308
|
- features/choose_javascript_database_strategy.feature
|
298
309
|
- features/database_cleaner.feature
|
299
310
|
- features/emulate_javascript.feature
|
300
|
-
- features/field_with_errors.feature
|
301
311
|
- features/fixing_bundler_pre.feature
|
302
|
-
- features/inspect_query_string.feature
|
303
312
|
- features/install_cucumber_rails.feature
|
304
313
|
- features/mongoid.feature
|
305
314
|
- features/multiple_databases.feature
|
@@ -338,6 +347,7 @@ files:
|
|
338
347
|
- lib/generators/cucumber/install/templates/support/rails.rb.erb
|
339
348
|
- lib/generators/cucumber/install/templates/support/rails_spork.rb.erb
|
340
349
|
- lib/generators/cucumber/install/templates/tasks/cucumber.rake.erb
|
350
|
+
- spec/cucumber/rails/database_spec.rb
|
341
351
|
- spec/generators/cucumber/install/install_generator_spec.rb
|
342
352
|
- spec/spec_helper.rb
|
343
353
|
homepage: http://cukes.info
|
@@ -363,16 +373,14 @@ rubyforge_project:
|
|
363
373
|
rubygems_version: 1.8.10
|
364
374
|
signing_key:
|
365
375
|
specification_version: 3
|
366
|
-
summary: cucumber-rails-1.2.
|
376
|
+
summary: cucumber-rails-1.2.1
|
367
377
|
test_files:
|
368
378
|
- features/allow_rescue.feature
|
369
379
|
- features/capybara_javascript_drivers.feature
|
370
380
|
- features/choose_javascript_database_strategy.feature
|
371
381
|
- features/database_cleaner.feature
|
372
382
|
- features/emulate_javascript.feature
|
373
|
-
- features/field_with_errors.feature
|
374
383
|
- features/fixing_bundler_pre.feature
|
375
|
-
- features/inspect_query_string.feature
|
376
384
|
- features/install_cucumber_rails.feature
|
377
385
|
- features/mongoid.feature
|
378
386
|
- features/multiple_databases.feature
|
@@ -386,6 +394,7 @@ test_files:
|
|
386
394
|
- features/support/fixtures/bundler-1.0.21.gem
|
387
395
|
- features/support/fixtures/bundler-1.1.rc.gem
|
388
396
|
- features/support/legacy_web_steps_support.rb
|
397
|
+
- spec/cucumber/rails/database_spec.rb
|
389
398
|
- spec/generators/cucumber/install/install_generator_spec.rb
|
390
399
|
- spec/spec_helper.rb
|
391
400
|
has_rdoc:
|
@@ -1,70 +0,0 @@
|
|
1
|
-
Feature: Detecting a field has errors on it
|
2
|
-
|
3
|
-
Scenario: A form with some fields with errors
|
4
|
-
Given I have created a new Rails 3 app and installed cucumber-rails
|
5
|
-
And I successfully run `rails generate scaffold enemy name:string nickname:string`
|
6
|
-
And I write to "app/models/enemy.rb" with:
|
7
|
-
"""
|
8
|
-
class Enemy < ActiveRecord::Base
|
9
|
-
validates_presence_of :name
|
10
|
-
end
|
11
|
-
"""
|
12
|
-
And I write to "features/f.feature" with:
|
13
|
-
"""
|
14
|
-
Feature: Enemy form
|
15
|
-
Scenario: Making an enemy
|
16
|
-
Given I am on the new enemy page
|
17
|
-
And I press "Create Enemy"
|
18
|
-
Then the "Name" field should have the error "can't be blank"
|
19
|
-
And the "Nickname" field should have no error
|
20
|
-
"""
|
21
|
-
When I run `bundle exec rake db:migrate`
|
22
|
-
And I run `bundle exec rake cucumber`
|
23
|
-
Then it should pass with:
|
24
|
-
"""
|
25
|
-
1 scenario (1 passed)
|
26
|
-
4 steps (4 passed)
|
27
|
-
"""
|
28
|
-
|
29
|
-
Scenario: A formtastic form with some fields with errors
|
30
|
-
Given I have created a new Rails 3 app and installed cucumber-rails
|
31
|
-
And I append to "Gemfile" with:
|
32
|
-
"""
|
33
|
-
gem "formtastic"
|
34
|
-
"""
|
35
|
-
And I successfully run `bundle`
|
36
|
-
And I successfully run `rails generate scaffold enemy name:string nickname:string`
|
37
|
-
And I write to "app/models/enemy.rb" with:
|
38
|
-
"""
|
39
|
-
class Enemy < ActiveRecord::Base
|
40
|
-
validates_presence_of :name
|
41
|
-
end
|
42
|
-
"""
|
43
|
-
And I write to "features/f.feature" with:
|
44
|
-
"""
|
45
|
-
Feature: Enemy form
|
46
|
-
Scenario: Making an enemy
|
47
|
-
Given I am on the new enemy page
|
48
|
-
And I press "Create Enemy"
|
49
|
-
Then the "Name" field should have the error "can't be blank"
|
50
|
-
And the "Nickname" field should have no error
|
51
|
-
"""
|
52
|
-
And I write to "app/views/enemies/new.html.erb" with:
|
53
|
-
"""
|
54
|
-
<%= semantic_form_for(@enemy) do |form| %>
|
55
|
-
<%= form.inputs do %>
|
56
|
-
<%= form.input :name %>
|
57
|
-
<%= form.input :nickname %>
|
58
|
-
<% end %>
|
59
|
-
<%= form.buttons do %>
|
60
|
-
<%= form.commit_button %>
|
61
|
-
<% end %>
|
62
|
-
<% end %>
|
63
|
-
"""
|
64
|
-
When I run `bundle exec rake db:migrate`
|
65
|
-
And I run `bundle exec rake cucumber`
|
66
|
-
Then it should pass with:
|
67
|
-
"""
|
68
|
-
1 scenario (1 passed)
|
69
|
-
4 steps (4 passed)
|
70
|
-
"""
|
@@ -1,35 +0,0 @@
|
|
1
|
-
Feature: Inspect query string
|
2
|
-
|
3
|
-
Scenario: Inspect query string
|
4
|
-
Given I have created a new Rails 3 app and installed cucumber-rails
|
5
|
-
And I successfully run `rails generate scaffold cuke name:string`
|
6
|
-
And I overwrite "app/controllers/cukes_controller.rb" with:
|
7
|
-
"""
|
8
|
-
class CukesController < ApplicationController
|
9
|
-
def index
|
10
|
-
redirect_to cuke_path(10, {:name => 'cucumber', :what => 'vegetable'})
|
11
|
-
end
|
12
|
-
|
13
|
-
def show
|
14
|
-
render :text => "Cuke #{params[:id]}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
"""
|
18
|
-
And I write to "features/tests.feature" with:
|
19
|
-
"""
|
20
|
-
Feature: Tests
|
21
|
-
Scenario: Tests
|
22
|
-
When I go to the cukes page
|
23
|
-
Then I should have the following query string:
|
24
|
-
| name | cucumber |
|
25
|
-
| what | vegetable |
|
26
|
-
And I should see "Cuke 10"
|
27
|
-
"""
|
28
|
-
And I run `bundle exec rake db:migrate`
|
29
|
-
And I run `bundle exec rake cucumber`
|
30
|
-
Then it should pass with:
|
31
|
-
"""
|
32
|
-
1 scenario (1 passed)
|
33
|
-
3 steps (3 passed)
|
34
|
-
"""
|
35
|
-
|