cucumber_factory 1.11.2 → 1.11.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -4,10 +4,12 @@ module CucumberFactory
|
|
4
4
|
|
5
5
|
def find_last(klass)
|
6
6
|
# Don't use class.last, in sqlite that is not always the last inserted element
|
7
|
+
# If created_at is available prefer it over id as column for ordering so that we can handle UUIDs
|
8
|
+
order_column = klass.column_names.include?('created_at') ? 'created_at, id' : 'id'
|
7
9
|
if Rails::VERSION::MAJOR < 4
|
8
|
-
klass.find(:last, :order =>
|
10
|
+
klass.find(:last, :order => order_column)
|
9
11
|
else
|
10
|
-
klass.order(
|
12
|
+
klass.order(order_column).last
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
@@ -154,6 +154,19 @@ describe 'steps provided by cucumber_factory' do
|
|
154
154
|
|
155
155
|
it "should allow to set a belongs_to association to a previously created record by saying 'above'" do
|
156
156
|
invoke_cucumber_step('there is a user with the name "Jane"')
|
157
|
+
invoke_cucumber_step('there is a user with the name "John"')
|
158
|
+
invoke_cucumber_step('there is a movie with the title "Limitless"')
|
159
|
+
invoke_cucumber_step('there is a movie with the title "Before Sunrise"')
|
160
|
+
invoke_cucumber_step('there is a movie with the title "Before Sunset" and the reviewer above and the prequel above')
|
161
|
+
before_sunset = Movie.find_by_title!("Before Sunset")
|
162
|
+
before_sunset.prequel.title.should == "Before Sunrise"
|
163
|
+
before_sunset.reviewer.name.should == "John"
|
164
|
+
end
|
165
|
+
|
166
|
+
it "should give created_at precedence over id when saying 'above' so that records with UUIDs are handled correctly" do
|
167
|
+
invoke_cucumber_step('there is a user with the name "Jane"')
|
168
|
+
invoke_cucumber_step('there is a user with the name "John"')
|
169
|
+
User.find_by_name("John").update_attributes!(:created_at => 1.day.ago)
|
157
170
|
invoke_cucumber_step('there is a movie with the title "Limitless"')
|
158
171
|
invoke_cucumber_step('there is a movie with the title "Before Sunrise"')
|
159
172
|
invoke_cucumber_step('there is a movie with the title "Before Sunset" and the reviewer above and the prequel above')
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.3
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Henning Koch
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
+
date: 2015-11-02 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: rails
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :development
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: rspec
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - <
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - <
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: rspec-rails
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - '='
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - '='
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,6 +62,7 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: sqlite3
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
67
|
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
@@ -62,6 +70,7 @@ dependencies:
|
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
75
|
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
@@ -69,6 +78,7 @@ dependencies:
|
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: cucumber
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
@@ -76,6 +86,7 @@ dependencies:
|
|
76
86
|
type: :runtime
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
91
|
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
@@ -83,6 +94,7 @@ dependencies:
|
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: activesupport
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :runtime
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -207,25 +220,26 @@ files:
|
|
207
220
|
homepage: http://github.com/makandra/cucumber_factory
|
208
221
|
licenses:
|
209
222
|
- MIT
|
210
|
-
metadata: {}
|
211
223
|
post_install_message:
|
212
224
|
rdoc_options: []
|
213
225
|
require_paths:
|
214
226
|
- lib
|
215
227
|
required_ruby_version: !ruby/object:Gem::Requirement
|
228
|
+
none: false
|
216
229
|
requirements:
|
217
230
|
- - ! '>='
|
218
231
|
- !ruby/object:Gem::Version
|
219
232
|
version: '0'
|
220
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
221
235
|
requirements:
|
222
236
|
- - ! '>='
|
223
237
|
- !ruby/object:Gem::Version
|
224
238
|
version: '0'
|
225
239
|
requirements: []
|
226
240
|
rubyforge_project:
|
227
|
-
rubygems_version:
|
241
|
+
rubygems_version: 1.8.30
|
228
242
|
signing_key:
|
229
|
-
specification_version:
|
243
|
+
specification_version: 3
|
230
244
|
summary: Create records from Cucumber features without writing step definitions.
|
231
245
|
test_files: []
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
ZTFmYjM0ZDJkOTcyZjU3MGMwNmRiMTk0ODZlMmRmNzVlMGE5NDZjYw==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NDUyOTlkMDM0ZTgwM2YwYmQ2ZmFiNDdiODY1MTc0OTJkYTM5ZTkxMA==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ZTBlNTIxODA0MGE2ZTQyMmNkNDU5YWIxY2YyNjg2NTU0OTQwZmY4YzUxN2Jj
|
10
|
-
NTQwZDk5ODAzN2Y0YmE5YzQzYTY0Y2E4NTNjODk3NGVjZjdjNzZiZjM4Yzhi
|
11
|
-
OWJmM2I3NDU4NWFlOWFlZjllMzlhZGZmODAwYjE3OGE5NmRjNjg=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NzMxOTE5OGJhM2I1ZTI0OGViNzc1ZGIyNTNhOTZkOGRiYzMxNmRmNTZiYTJk
|
14
|
-
MzhkMThmMjVhOTYxYzdkODEyNGFkMzMxZjhlMjJiZWU2ODhhM2IwNzliM2Ix
|
15
|
-
N2I5N2E0ZjQwMGQ3MzdhNjg2YmZlYjI5MmFjMWU0Nzg0NzRjYzQ=
|