Skip to content

Commit 4c885a3

Browse files
committed
More suitable casted_options in spec
1 parent 9b360eb commit 4c885a3

1 file changed

Lines changed: 88 additions & 86 deletions

File tree

spec/imgproxy_spec.rb

Lines changed: 88 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -125,97 +125,99 @@
125125
}
126126
end
127127

128-
# rubocop: disable Layout/LineEndStringConcatenationIndentation
129128
let(:casted_options) do
130-
"rs:auto:100:200:1:1:noea:1:2/"\
131-
"s:150:250:0:1:soea:2:3/"\
132-
"rt:fill/"\
133-
"ra:cubic/"\
134-
"w:200/"\
135-
"h:300/"\
136-
"dpr:2/"\
137-
"el:1/"\
138-
"ex:1:nowe:5:6/"\
139-
"g:fp:0.25:0.75/"\
140-
"c:500:100:ce:0.35:0.65/"\
141-
"pd:10:20/"\
142-
"t:10:ffffff:1:0/"\
143-
"rot:90/"\
144-
"q:80/"\
145-
"mb:1024/"\
146-
"bg:abcdfe/"\
147-
"bga:0.5/"\
148-
"a:-10:0.5:2/"\
149-
"br:10/"\
150-
"co:2/"\
151-
"sa:0.5/"\
152-
"bl:0.5/"\
153-
"sh:0.7/"\
154-
"pix:10/"\
155-
"ush:always/"\
156-
"wm:0.5:noea:10:5:0.1/"\
157-
"wmu:aHR0cHM6Ly9pbWFnZXMudGVzdC93bS5zdmc/"\
158-
"st:Y29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgLjUp/"\
159-
"jpego:1:0:1:0:1:5/"\
160-
"pngo:0:1:128/"\
161-
"gifo:1:0/"\
162-
"pg:42/"\
163-
"vts:15/"\
164-
"pr:preset1:preset2/"\
165-
"cb:qwerty/" \
166-
"sm:1/"\
167-
"scp:0/"\
168-
"ar:1/"\
169-
"fn:the_image.jpg/"\
170-
"att:1/"\
171-
"exp:4810374983"
129+
[
130+
"rs:auto:100:200:1:1:noea:1:2",
131+
"s:150:250:0:1:soea:2:3",
132+
"rt:fill",
133+
"ra:cubic",
134+
"w:200",
135+
"h:300",
136+
"dpr:2",
137+
"el:1",
138+
"ex:1:nowe:5:6",
139+
"g:fp:0.25:0.75",
140+
"c:500:100:ce:0.35:0.65",
141+
"pd:10:20",
142+
"t:10:ffffff:1:0",
143+
"rot:90",
144+
"q:80",
145+
"mb:1024",
146+
"bg:abcdfe",
147+
"bga:0.5",
148+
"a:-10:0.5:2",
149+
"br:10",
150+
"co:2",
151+
"sa:0.5",
152+
"bl:0.5",
153+
"sh:0.7",
154+
"pix:10",
155+
"ush:always",
156+
"wm:0.5:noea:10:5:0.1",
157+
"wmu:aHR0cHM6Ly9pbWFnZXMudGVzdC93bS5zdmc",
158+
"st:Y29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgLjUp",
159+
"jpego:1:0:1:0:1:5",
160+
"pngo:0:1:128",
161+
"gifo:1:0",
162+
"pg:42",
163+
"vts:15",
164+
"pr:preset1:preset2",
165+
"cb:qwerty",
166+
"sm:1",
167+
"scp:0",
168+
"ar:1",
169+
"fn:the_image.jpg",
170+
"att:1",
171+
"exp:4810374983",
172+
].join("/")
172173
end
173174

174175
let(:casted_options_full) do
175-
"resize:auto:100:200:1:1:noea:1:2/"\
176-
"size:150:250:0:1:soea:2:3/"\
177-
"resizing_type:fill/"\
178-
"resizing_algorithm:cubic/"\
179-
"width:200/"\
180-
"height:300/"\
181-
"dpr:2/"\
182-
"enlarge:1/"\
183-
"extend:1:nowe:5:6/"\
184-
"gravity:fp:0.25:0.75/"\
185-
"crop:500:100:ce:0.35:0.65/"\
186-
"padding:10:20/"\
187-
"trim:10:ffffff:1:0/"\
188-
"rotate:90/"\
189-
"quality:80/"\
190-
"max_bytes:1024/"\
191-
"background:abcdfe/"\
192-
"background_alpha:0.5/"\
193-
"adjust:-10:0.5:2/"\
194-
"brightness:10/"\
195-
"contrast:2/"\
196-
"saturation:0.5/"\
197-
"blur:0.5/"\
198-
"sharpen:0.7/"\
199-
"pixelate:10/"\
200-
"unsharpening:always/"\
201-
"watermark:0.5:noea:10:5:0.1/"\
202-
"watermark_url:aHR0cHM6Ly9pbWFnZXMudGVzdC93bS5zdmc/"\
203-
"style:Y29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgLjUp/"\
204-
"jpeg_options:1:0:1:0:1:5/"\
205-
"png_options:0:1:128/"\
206-
"gif_options:1:0/"\
207-
"page:42/"\
208-
"video_thumbnail_second:15/"\
209-
"preset:preset1:preset2/"\
210-
"cachebuster:qwerty/" \
211-
"strip_metadata:1/"\
212-
"strip_color_profile:0/"\
213-
"auto_rotate:1/"\
214-
"filename:the_image.jpg/"\
215-
"return_attachment:1/"\
216-
"expires:4810374983"
176+
[
177+
"resize:auto:100:200:1:1:noea:1:2",
178+
"size:150:250:0:1:soea:2:3",
179+
"resizing_type:fill",
180+
"resizing_algorithm:cubic",
181+
"width:200",
182+
"height:300",
183+
"dpr:2",
184+
"enlarge:1",
185+
"extend:1:nowe:5:6",
186+
"gravity:fp:0.25:0.75",
187+
"crop:500:100:ce:0.35:0.65",
188+
"padding:10:20",
189+
"trim:10:ffffff:1:0",
190+
"rotate:90",
191+
"quality:80",
192+
"max_bytes:1024",
193+
"background:abcdfe",
194+
"background_alpha:0.5",
195+
"adjust:-10:0.5:2",
196+
"brightness:10",
197+
"contrast:2",
198+
"saturation:0.5",
199+
"blur:0.5",
200+
"sharpen:0.7",
201+
"pixelate:10",
202+
"unsharpening:always",
203+
"watermark:0.5:noea:10:5:0.1",
204+
"watermark_url:aHR0cHM6Ly9pbWFnZXMudGVzdC93bS5zdmc",
205+
"style:Y29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgLjUp",
206+
"jpeg_options:1:0:1:0:1:5",
207+
"png_options:0:1:128",
208+
"gif_options:1:0",
209+
"page:42",
210+
"video_thumbnail_second:15",
211+
"preset:preset1:preset2",
212+
"cachebuster:qwerty",
213+
"strip_metadata:1",
214+
"strip_color_profile:0",
215+
"auto_rotate:1",
216+
"filename:the_image.jpg",
217+
"return_attachment:1",
218+
"expires:4810374983",
219+
].join("/")
217220
end
218-
# rubocop: enable Layout/LineEndStringConcatenationIndentation
219221

220222
subject(:url) { described_class.url_for(src_url, options) }
221223

0 commit comments

Comments
 (0)