This repository was archived by the owner on Feb 23, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
spec/serializers/spree/wombat Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ module Wombat
94
94
ActionController ::Base . asset_host = "http://myapp.dev"
95
95
image = File . open ( File . expand_path ( '../../../../fixtures/thinking-cat.jpg' , __FILE__ ) )
96
96
3 . times . each_with_index do |i |
97
- product . images . create! ( attachment : image , position : i , alt : "variant image #{ i } " )
97
+ product . images . create! ( attachment : image , alt : "variant image #{ i } " )
98
98
end
99
99
end
100
100
@@ -103,7 +103,7 @@ module Wombat
103
103
dimension_hash = { "height" => 490 , "width" => 489 }
104
104
3 . times . each_with_index do |i |
105
105
expect ( serialized_product [ "images" ] [ i ] [ "url" ] ) . to match /http:\/ \/ myapp.dev\/ spree\/ products\/ \d *\/ original\/ thinking-cat.jpg\z /
106
- expect ( serialized_product [ "images" ] [ i ] [ "position" ] ) . to eql i
106
+ expect ( serialized_product [ "images" ] [ i ] [ "position" ] ) . to eql ( i + 1 )
107
107
expect ( serialized_product [ "images" ] [ i ] [ "title" ] ) . to eql "variant image #{ i } "
108
108
expect ( serialized_product [ "images" ] [ i ] [ "type" ] ) . to eql "original"
109
109
expect ( serialized_product [ "images" ] [ i ] [ "dimensions" ] ) . to eql dimension_hash
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ module Wombat
53
53
ActionController ::Base . asset_host = "http://myapp.dev"
54
54
image = File . open ( File . expand_path ( '../../../../fixtures/thinking-cat.jpg' , __FILE__ ) )
55
55
3 . times . each_with_index do |i |
56
- variant . images . create! ( attachment : image , position : i , alt : "variant image #{ i } " )
56
+ variant . images . create! ( attachment : image , alt : "variant image #{ i } " )
57
57
end
58
58
end
59
59
@@ -62,7 +62,7 @@ module Wombat
62
62
dimension_hash = { "height" => 490 , "width" => 489 }
63
63
3 . times . each_with_index do |i |
64
64
expect ( serialized_variant [ "images" ] [ i ] [ "url" ] ) . to match /http:\/ \/ myapp.dev\/ spree\/ products\/ \d *\/ original\/ thinking-cat.jpg\z /
65
- expect ( serialized_variant [ "images" ] [ i ] [ "position" ] ) . to eql i
65
+ expect ( serialized_variant [ "images" ] [ i ] [ "position" ] ) . to eql ( i + 1 )
66
66
expect ( serialized_variant [ "images" ] [ i ] [ "title" ] ) . to eql "variant image #{ i } "
67
67
expect ( serialized_variant [ "images" ] [ i ] [ "type" ] ) . to eql "original"
68
68
expect ( serialized_variant [ "images" ] [ i ] [ "dimensions" ] ) . to eql dimension_hash
You can’t perform that action at this time.
0 commit comments