Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
antopalidi committed Aug 4, 2023
1 parent 0cc00c7 commit 6d01914
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ GEM
net-smtp (0.3.3)
net-protocol
nio4r (2.5.9)
nokogiri (1.14.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.5-x86_64-linux)
racc (~> 1.4)
oauth (1.1.0)
Expand Down Expand Up @@ -796,6 +798,7 @@ GEM
zeitwerk (2.6.10)

PLATFORMS
x86_64-darwin-22
x86_64-linux

DEPENDENCIES
Expand Down
16 changes: 13 additions & 3 deletions spec/system/agenda_events_settings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@
fill_in :newsletter_subject_en, with: "Subject"
find('input[name="newsletter[settings][intro_title_en]"]').fill_in with: "Intro title"
page.execute_script("document.querySelector('input[name=\"newsletter[settings][intro_text_en]\"]').value = 'Intro text';")
attach_file("newsletter[images][main_image]", Decidim::Dev.asset("city.jpeg"))
click_button "Add file"
attach_file("newsletter[images][main_image][]", Decidim::Dev.asset("city.jpeg"), visible: :hidden)
sleep 1
find(".add-file-main_image").click

click_link "Body"
find('input[name="newsletter[settings][body_title_en]"]').fill_in with: "Body title"
Expand All @@ -122,7 +125,10 @@
find("input[name='newsletter[settings][body_box_description_#{i}_en]']").fill_in with: "Event description #{i}"
find("input[name='newsletter[settings][body_box_link_text_#{i}_en]']").fill_in with: "Event link text #{i}"
find("input[name='newsletter[settings][body_box_link_url_#{i}_en]']").fill_in with: "http://www.example.org"
attach_file("newsletter[images][body_box_image_#{i}]", Decidim::Dev.asset("city2.jpeg"))
find("#newsletter_images_body_box_image_#{i}_button").click
attach_file("newsletter[images][body_box_image_#{i}][]", Decidim::Dev.asset("city2.jpeg"), visible: :hidden)
sleep 1
find(".add-file-body_box_image_#{i}").click
end

find("input[name='newsletter[settings][body_final_text_en]']").fill_in with: "Final text"
Expand All @@ -137,12 +143,16 @@
find("input[name='newsletter[settings][footer_box_title_#{i}_en]']").fill_in with: "Footer event title #{i}"
find("input[name='newsletter[settings][footer_box_link_text_#{i}_en]']").fill_in with: "Footer event link #{i}"
find("input[name='newsletter[settings][footer_box_link_url_#{i}_en]']").fill_in with: "http://www.example.org/footer"
attach_file("newsletter[images][footer_box_image_#{i}]", Decidim::Dev.asset("city3.jpeg"))
find("#newsletter_images_footer_box_image_#{i}_button").click
attach_file("newsletter[images][footer_box_image_#{i}][]", Decidim::Dev.asset("city3.jpeg"), visible: :hidden)
sleep 1
find(".add-file-footer_box_image_#{i}").click
end

page.execute_script("document.querySelector('input[name=\"newsletter[settings][footer_address_text]\"]').value = 'Barcelona, Spain';")

click_button "Save"
sleep 1
end

it "renders the correct the settings form" do
Expand Down

0 comments on commit 6d01914

Please sign in to comment.