Initial commit
This commit is contained in:
51
spec/helpers/images_helper_spec.rb
Normal file
51
spec/helpers/images_helper_spec.rb
Normal file
@@ -0,0 +1,51 @@
|
||||
require "rails_helper"
|
||||
|
||||
RSpec.describe ImagesHelper do
|
||||
describe "#thumbnail_variant" do
|
||||
it "calls variant with orient and size options" do
|
||||
attachment = double(:attachment)
|
||||
allow(attachment).to receive(:variant)
|
||||
|
||||
helper.thumbnail_variant(attachment)
|
||||
|
||||
expect(attachment).to have_received(:variant).with(
|
||||
gravity: "center",
|
||||
resize: "75x75>",
|
||||
extent: "75x75",
|
||||
background: "#fff",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#medium_variant" do
|
||||
it "calls variant with orient and size options" do
|
||||
attachment = double(:attachment)
|
||||
allow(attachment).to receive(:variant)
|
||||
|
||||
helper.medium_variant(attachment)
|
||||
|
||||
expect(attachment).to have_received(:variant).with(
|
||||
gravity: "center",
|
||||
resize: "100x100>",
|
||||
extent: "100x100",
|
||||
background: "#fff",
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#large_variant" do
|
||||
it "calls variant with orient and size options" do
|
||||
attachment = double(:attachment)
|
||||
allow(attachment).to receive(:variant)
|
||||
|
||||
helper.large_variant(attachment)
|
||||
|
||||
expect(attachment).to have_received(:variant).with(
|
||||
gravity: "center",
|
||||
resize: "150x150>",
|
||||
extent: "150x150",
|
||||
background: "#fff",
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user