1 # frozen_string_literal: true
3 require "application_system_test_case"
5 class ManageModerationZones < ApplicationSystemTestCase
6 test "Create a moderation zone and fail to put an anonymous note within it" do
7 sign_in_as(create(:moderator_user))
9 visit moderation_zones_path
10 click_on "New Moderation Zone"
12 fill_in "Name", :with => "Test zone"
13 fill_in "Reason", :with => "He's a very naughty boy"
15 map = find_by_id("map")
16 map.click(:offset => :center, :x => -50, :y => -50)
17 map.click(:offset => :center, :x => 0, :y => -50)
18 map.click(:offset => :center, :x => 0, :y => 0)
19 map.click(:offset => :center, :x => -50, :y => 0)
20 map.click(:offset => :center, :x => -50, :y => -50)
22 select "1 week", :from => :moderation_zone_period
23 click_on "Create Moderation zone"
24 assert_content "Moderation zone created"
27 visit new_note_path(:anchor => "map=18/7.15/-9.23")
29 fill_in "text", :with => "Hahaha! Nobody expects the Spanish anonymous notes!"
32 assert_content "There was an error when creating the note"