diff options
| author | Robert | 2017-08-14 18:42:08 +0200 | 
|---|---|---|
| committer | Robert | 2017-08-15 17:22:34 +0200 | 
| commit | 373a4089173795d011ebd6adf7382b2a5e40a51b (patch) | |
| tree | 1f5580f5d57f08b7361a19b21a161ac98b04d255 /spec/support/helpers | |
| parent | c16c03b91174cf637e0bd2f0e3336e3788f43e59 (diff) | |
| download | chouette-core-373a4089173795d011ebd6adf7382b2a5e40a51b.tar.bz2 | |
Refs: #4189@2h; Iimplementation of Chouette::Route#duplicate & Chouette::StopPoint#duplicate
   With the following unspecified behaviour concerning `objectid` and `object_version`
   - The duplicated Route objectid is passed into Route#duplicate
   - The duplicated StopPoint objectids are constructed from the source's objectids (parts 2 & 3) and the route's objectid (part 1)
   - the duplicated Route object_version equals the source's one
Diffstat (limited to 'spec/support/helpers')
| -rw-r--r-- | spec/support/helpers/model_compare_helpers.rb | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/support/helpers/model_compare_helpers.rb b/spec/support/helpers/model_compare_helpers.rb new file mode 100644 index 000000000..97e26f300 --- /dev/null +++ b/spec/support/helpers/model_compare_helpers.rb @@ -0,0 +1,12 @@ +module Support::ModelCompareHelpers +   +  def values_for_create obj, except: [] +    keys = obj.attributes.keys - except - %w{id created_at updated_at} +    obj.attributes.slice(*keys) +  end + +end + +RSpec.configure do | rspec | +  rspec.include Support::ModelCompareHelpers, type: :model +end  | 
