Add more images to admin site customization

This commit is contained in:
decabeza
2022-05-19 20:34:09 +02:00
committed by Javi Martín
parent 11bed74678
commit 10cd182774
12 changed files with 81 additions and 12 deletions

View File

@@ -20,4 +20,24 @@ describe Widget::Feeds::ProcessComponent do
expect(page).to have_css("img[alt='1. No Poverty']")
end
describe "image" do
it "shows the default image" do
render_inline component
expect(page).to have_css "img[src*='welcome_process']"
end
it "shows a custom default image when available" do
stub_const("#{SiteCustomization::Image}::VALID_IMAGES", { "welcome_process" => [260, 80] })
create(:site_customization_image,
name: "welcome_process",
image: fixture_file_upload("logo_header-260x80.png"))
render_inline component
expect(page).to have_css "img[src$='logo_header-260x80.png']"
expect(page).not_to have_css "img[src*='welcome_process']"
end
end
end