Extract poll question option images from shared nested imageable specs to system specs

This is the only it_behaves_like "nested imageable" call where the has_many_images parameter is set to true.

Previously, the shared example skipped or altered expectations based on this parameter. Now, this behavior is
moved to the factory level (:future_poll_question_option).

Since this is an administrative section, a related administrator is created for the user.
This commit is contained in:
taitus
2024-11-15 15:28:34 +01:00
parent 2212a2a2f4
commit 1cf85560dd
2 changed files with 18 additions and 15 deletions

View File

@@ -4,15 +4,6 @@ describe "Images", :admin do
let(:future_poll) { create(:poll, :future) }
let(:current_poll) { create(:poll) }
it_behaves_like "nested imageable",
"future_poll_question_option",
"new_admin_option_image_path",
{ option_id: "id" },
nil,
"Save image",
"Image uploaded successfully",
true
context "Index" do
scenario "Option with no images" do
option = create(:poll_question_option)