Remove show_caption_for? method

The `show_caption_for?` method was used to determine whether to check for the
presence of a `figcaption` element, but its only purpose was to skip the check
when the factory was `:budget.

The reason we skip the `figcaption` check for `:budget` is that it is the only case
where the test is verifying the form's edit page, where displaying a `figcaption` does
not make sense.
This commit is contained in:
taitus
2024-11-21 15:18:57 +01:00
parent 3fd2a1f498
commit fdee159185

View File

@@ -163,10 +163,12 @@ describe "Nested imageable" do
expect(page).to have_content notice_text
visit edit_admin_budget_path(imageable) if factory == :budget
if factory == :budget
click_link "Go back to edit budget"
else
expect(page).to have_css "figure figcaption"
end
expect(page).to have_css "figure img"
expect(page).to have_css "figure figcaption" if show_caption_for?(factory)
end
scenario "Different URLs for different images" do
@@ -204,10 +206,6 @@ describe "Nested imageable" do
end
end
def show_caption_for?(factory)
factory != :budget
end
def fill_in_required_fields
return if edit_path?