cucumber-openerpscenario 0.1.5 → 0.1.6

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.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{cucumber-openerpscenario}
3
- s.version = "0.1.5"
3
+ s.version = "0.1.6"
4
4
  s.date = %q{2013-03-06}
5
5
  s.authors = ["Nicolas Bessi - Camptocamp"]
6
6
  s.summary = %q{cucumber on OpenERP}
@@ -61,15 +61,22 @@ def manage_item_table(item, table)
61
61
  fields.merge! item.class.many2one_associations
62
62
  fields.merge! item.class.one2many_associations
63
63
  fields.merge! item.class.many2many_associations
64
-
64
+
65
65
  table.hashes.each do |dict|
66
66
  if fields[dict['name']]
67
67
  rel_item = _manage_col_search(fields[dict['name']], dict['value'])
68
68
  eval "item.#{dict['name']} = rel_item.id"
69
69
  else
70
- eval "item.#{dict['name']} = dict['value']"
70
+ value = dict['value']
71
+ v_type = item.class.fields.fetch(dict['name'],{}).fetch('type', nil)
72
+ if v_type == 'integer'
73
+ value = Integer(value)
74
+ elsif v_type == 'float'
75
+ value = Float(value)
76
+ end
77
+ eval "item.#{dict['name']} = value"
71
78
  end
72
- end
79
+ end
73
80
  end
74
81
 
75
82
  Given /^I (create|need|should have|find|find or create) (a|all|last) "([^"]*)" with (.*)$/ do |action, qty, model, args|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: cucumber-openerpscenario
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.5
5
+ version: 0.1.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Nicolas Bessi - Camptocamp
@@ -82,11 +82,6 @@ files:
82
82
  - README.txt
83
83
  - bin/cucumber-openerp
84
84
  - cucumber-openerp.gemspec
85
- - cucumber-openerpscenario-0.1.0.gem
86
- - cucumber-openerpscenario-0.1.1.gem
87
- - cucumber-openerpscenario-0.1.2.gem
88
- - cucumber-openerpscenario-0.1.3.gem
89
- - cucumber-openerpscenario-0.1.4.gem
90
85
  - lib/.DS_Store
91
86
  - lib/cucumber/.DS_Store
92
87
  - lib/cucumber/lib/.DS_Store