Files
old-holivud2/spec/helpers/images_helper_spec.rb
2020-05-31 22:38:19 +02:00

52 lines
1.2 KiB
Ruby

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