mdoel-cukesteps 0.6.0 → 0.6.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.
@@ -19,15 +19,19 @@ in concise language. Consider an application with models for restaurant, brand,
19
19
  location. Brand instances are pre-seeded into your database (e.g. for dropdown lists and other
20
20
  similar uses). You might want to create a test world like:
21
21
 
22
- Given the following employees exist
23
- | employee | name |
24
- | first | joe |
25
- | second | sally |
26
- | third | william |
27
- Given the following restaurants exist
28
- | Location | Brand | Employees |
29
- | Miami, fl | McDonalds | first |
30
- | Columbus | Chipotle | second,third |
22
+ Scenario: Linked objects with parent object defined first
23
+ Given the following restaurants exist
24
+ | restaurant | Location | Brand |
25
+ | mcd-miami | Miami, fl | McDonalds |
26
+ | chip-cols | Columbus | Chipotle |
27
+ Given the following employees exist
28
+ | name | restaurant |
29
+ | joe | mcd-miami |
30
+ | sally | chip-cols |
31
+ | william | chip-cols |
32
+ Then 2 restaurants should exist
33
+ And 3 employees should exist
34
+ And the "Chipotle" restaurant in "Columbus" has 2 employees
31
35
 
32
36
  If you put the following in your features/support/env.rb file:
33
37
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{cukesteps}
5
- s.version = "0.6.0"
5
+ s.version = "0.6.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Mike Doel"]
@@ -40,18 +40,12 @@ module CukeAssociationHelpers
40
40
  if @created_objects[cached_key].nil?
41
41
  attributes[symbolized_key] = build_value(symbolized_key,value)
42
42
  else
43
- attributes[symbolized_key] = saved_objects(cached_key,value)
43
+ attributes[symbolized_key] = @created_objects[cached_key][value]
44
44
  end
45
45
  end
46
46
  attributes
47
47
  end
48
48
 
49
- def saved_objects(klass,value)
50
- objects = []
51
- value.split(",").each {|o| objects << @created_objects[klass][o]}
52
- objects
53
- end
54
-
55
49
  def build_value(key,value)
56
50
  if @@associated_cuke_builders[key].nil?
57
51
  value
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdoel-cukesteps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Doel