diff --git a/spec/shared/system/admin_progressable.rb b/spec/shared/system/admin_progressable.rb index 10260dc38..b0a10200d 100644 --- a/spec/shared/system/admin_progressable.rb +++ b/spec/shared/system/admin_progressable.rb @@ -28,7 +28,7 @@ shared_examples "admin_progressable" do |factory_name, path_name| end context "New" do - scenario "Primary progress bar", :js do + scenario "Primary progress bar" do visit path click_link "Create new progress bar" @@ -46,7 +46,7 @@ shared_examples "admin_progressable" do |factory_name, path_name| expect(page).to have_content "Primary progress bar" end - scenario "Secondary progress bar", :js do + scenario "Secondary progress bar" do visit path click_link "Create new progress bar" @@ -66,7 +66,7 @@ shared_examples "admin_progressable" do |factory_name, path_name| end context "Edit" do - scenario "Primary progress bar", :js do + scenario "Primary progress bar" do bar = create(:progress_bar, progressable: progressable) visit path @@ -86,7 +86,7 @@ shared_examples "admin_progressable" do |factory_name, path_name| end end - scenario "Secondary progress bar", :js do + scenario "Secondary progress bar" do bar = create(:progress_bar, :secondary, progressable: progressable) visit path @@ -108,7 +108,7 @@ shared_examples "admin_progressable" do |factory_name, path_name| end context "Delete" do - scenario "Remove progress bar", :js do + scenario "Remove progress bar" do bar = create(:progress_bar, progressable: progressable, percentage: 34) visit path diff --git a/spec/shared/system/documentable.rb b/spec/shared/system/documentable.rb index d2901273b..062d978c0 100644 --- a/spec/shared/system/documentable.rb +++ b/spec/shared/system/documentable.rb @@ -95,7 +95,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path, end context "Destroy" do - scenario "Should show success notice after successful document upload", :js do + scenario "Should show success notice after successful document upload" do login_as documentable.author visit send(documentable_path, arguments) @@ -107,7 +107,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path, expect(page).to have_content "Document was deleted successfully." end - scenario "Should hide documents tab if there is no documents", :js do + scenario "Should hide documents tab if there is no documents" do login_as documentable.author visit send(documentable_path, arguments) @@ -119,7 +119,7 @@ shared_examples "documentable" do |documentable_factory_name, documentable_path, expect(page).not_to have_content "Documents (0)" end - scenario "Should redirect to documentable path after successful deletion", :js do + scenario "Should redirect to documentable path after successful deletion" do login_as documentable.author visit send(documentable_path, arguments) diff --git a/spec/shared/system/flaggable.rb b/spec/shared/system/flaggable.rb index 0e5bc8881..3b5ad64ef 100644 --- a/spec/shared/system/flaggable.rb +++ b/spec/shared/system/flaggable.rb @@ -21,7 +21,7 @@ shared_examples "flaggable" do |factory_name, admin: false| end end - scenario "Flagging as inappropriate", :js do + scenario "Flagging as inappropriate" do login_as(user) visit path @@ -42,7 +42,7 @@ shared_examples "flaggable" do |factory_name, admin: false| end end - scenario "Unflagging", :js do + scenario "Unflagging" do Flag.flag(user, flaggable) login_as(user) @@ -67,7 +67,7 @@ shared_examples "flaggable" do |factory_name, admin: false| end end - scenario "Flagging and unflagging", :js do + scenario "Flagging and unflagging" do login_as(user) visit path @@ -91,7 +91,7 @@ shared_examples "flaggable" do |factory_name, admin: false| end end - scenario "Flagging a comment with a child does not update its children", :js do + scenario "Flagging a comment with a child does not update its children" do skip "Only for comments" unless flaggable.is_a?(Comment) child_comment = create(:comment, commentable: flaggable.commentable, parent: flaggable) diff --git a/spec/shared/system/followable.rb b/spec/shared/system/followable.rb index 817538cb2..0d754d8e0 100644 --- a/spec/shared/system/followable.rb +++ b/spec/shared/system/followable.rb @@ -40,7 +40,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa expect(page).to have_link("Follow #{followable.model_name.human.downcase}") end - scenario "Should display unfollow after user clicks on follow button", :js do + scenario "Should display unfollow after user clicks on follow button" do user = create(:user) login_as(user) @@ -53,7 +53,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa end end - scenario "Should display new follower notice after user clicks on follow button", :js do + scenario "Should display new follower notice after user clicks on follow button" do user = create(:user) login_as(user) @@ -74,7 +74,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa expect(page).to have_link("Following") end - scenario "Updates follow button & show destroy notice after unfollow button is clicked", :js do + scenario "Updates follow button & show destroy notice after unfollow button is clicked" do user = create(:user, followables: [followable]) login_as(user) @@ -87,7 +87,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa end end - scenario "Should display destroy follower notice after user clicks on unfollow button", :js do + scenario "Should display destroy follower notice after user clicks on unfollow button" do user = create(:user, followables: [followable]) login_as(user) diff --git a/spec/shared/system/imageable.rb b/spec/shared/system/imageable.rb index 670d9fcab..6b39c17ea 100644 --- a/spec/shared/system/imageable.rb +++ b/spec/shared/system/imageable.rb @@ -13,7 +13,7 @@ shared_examples "imageable" do |imageable_factory_name, imageable_path, imageabl end context "Show" do - scenario "Show descriptive image when exists", :js do + scenario "Show descriptive image when exists" do image = create(:image, imageable: imageable) visit send(imageable_path, imageable_arguments) diff --git a/spec/shared/system/mappable.rb b/spec/shared/system/mappable.rb index 25d38328b..45954fa78 100644 --- a/spec/shared/system/mappable.rb +++ b/spec/shared/system/mappable.rb @@ -12,7 +12,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "At #{mappable_new_path}" do before { set_arguments(arguments, mappable, mappable_path_arguments) } - scenario "Should not show marker by default on create #{mappable_factory_name}", :js do + scenario "Should not show marker by default on create #{mappable_factory_name}" do do_login_for user visit send(mappable_new_path, arguments) @@ -23,7 +23,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "Should show marker on create #{mappable_factory_name} when click on map", :js do + scenario "Should show marker on create #{mappable_factory_name} when click on map" do do_login_for user visit send(mappable_new_path, arguments) @@ -35,7 +35,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "Should create #{mappable_factory_name} with map", :js do + scenario "Should create #{mappable_factory_name} with map" do do_login_for user visit send(mappable_new_path, arguments) @@ -46,7 +46,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_css(".map_location") end - scenario "Can not display map on #{mappable_factory_name} when not fill marker on map", :js do + scenario "Can not display map on #{mappable_factory_name} when not fill marker on map" do do_login_for user visit send(mappable_new_path, arguments) @@ -58,7 +58,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).not_to have_css(".map_location") end - scenario "Can not display map on #{mappable_factory_name} when feature.map is disabled", :js do + scenario "Can not display map on #{mappable_factory_name} when feature.map is disabled" do Setting["feature.map"] = false do_login_for user visit send(mappable_new_path, arguments) @@ -82,7 +82,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "When restoring the page from browser history" do before { Setting["org_name"] = "CONSUL" } - scenario "map should not be duplicated", :js do + scenario "map should not be duplicated" do do_login_for user visit send(mappable_new_path, arguments) @@ -103,7 +103,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "keeps marker and zoom defined by the user", :js do + scenario "keeps marker and zoom defined by the user" do do_login_for user visit send(mappable_new_path, arguments) @@ -137,7 +137,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "shows marker at map center", :js do + scenario "shows marker at map center" do do_login_for user visit send(mappable_new_path, arguments) @@ -170,7 +170,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "Skip map", :js do + scenario "Skip map" do do_login_for user visit send(mappable_new_path, arguments) @@ -181,7 +181,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).not_to have_content "Map location can't be blank" end - scenario "Toggle map", :js do + scenario "Toggle map" do do_login_for user visit send(mappable_new_path, arguments) @@ -200,7 +200,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, describe "At #{mappable_edit_path}" do before { skip } if mappable_edit_path.blank? - scenario "Should edit map on #{mappable_factory_name} and contain default values", :js do + scenario "Should edit map on #{mappable_factory_name} and contain default values" do do_login_for mappable.author visit send(mappable_edit_path, id: mappable.id) @@ -209,7 +209,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, validate_latitude_longitude(mappable_factory_name) end - scenario "Should edit default values from map on #{mappable_factory_name} edit page", :js do + scenario "Should edit default values from map on #{mappable_factory_name} edit page" do do_login_for mappable.author visit send(mappable_edit_path, id: mappable.id) @@ -222,7 +222,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_selector(".map_location[data-marker-latitude='#{mappable.map_location.latitude}']") end - scenario "Should edit mappable on #{mappable_factory_name} without change map", :js do + scenario "Should edit mappable on #{mappable_factory_name} without change map" do do_login_for mappable.author visit send(mappable_edit_path, id: mappable.id) @@ -235,7 +235,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).to have_selector(".map_location[data-marker-latitude='#{mappable.map_location.latitude}']") end - scenario "Can not display map on #{mappable_factory_name} edit when remove map marker", :js do + scenario "Can not display map on #{mappable_factory_name} edit when remove map marker" do do_login_for mappable.author visit send(mappable_edit_path, id: mappable.id) @@ -246,7 +246,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).not_to have_css(".map_location") end - scenario "Can not display map on #{mappable_factory_name} edit when feature.map is disabled", :js do + scenario "Can not display map on #{mappable_factory_name} edit when feature.map is disabled" do Setting["feature.map"] = false do_login_for mappable.author @@ -257,7 +257,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).not_to have_css(".map_location") end - scenario "No errors on update", :js do + scenario "No errors on update" do skip "" do_login_for mappable.author @@ -285,7 +285,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, do_login_for(user) if management end - scenario "Should display map and marker on #{mappable_factory_name} show page", :js do + scenario "Should display map and marker on #{mappable_factory_name} show page" do arguments[:id] = mappable.id visit send(mappable_show_path, arguments) @@ -295,7 +295,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, end end - scenario "Should not display map on #{mappable_factory_name} show when marker is not defined", :js do + scenario "Should not display map on #{mappable_factory_name} show when marker is not defined" do mappable_without_map = create(mappable_factory_name.to_s.to_sym) set_arguments(arguments, mappable_without_map, mappable_path_arguments) arguments[:id] = mappable_without_map.id @@ -305,7 +305,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name, expect(page).not_to have_css(".map_location") end - scenario "Should not display map on #{mappable_factory_name} show page when feature.map is disable", :js do + scenario "Should not display map on #{mappable_factory_name} show page when feature.map is disable" do Setting["feature.map"] = false arguments[:id] = mappable.id diff --git a/spec/shared/system/milestoneable.rb b/spec/shared/system/milestoneable.rb index 85be4bab0..d6c5df8ec 100644 --- a/spec/shared/system/milestoneable.rb +++ b/spec/shared/system/milestoneable.rb @@ -6,7 +6,7 @@ shared_examples "milestoneable" do |factory_name| describe "Show milestones" do let(:path) { polymorphic_path(milestoneable) } - scenario "Show milestones", :js do + scenario "Show milestones" do create(:milestone, milestoneable: milestoneable, description_en: "Last milestone with a link to https://consul.dev", description_es: "Último hito con el link https://consul.dev", @@ -44,7 +44,7 @@ shared_examples "milestoneable" do |factory_name| end end - scenario "Show no_milestones text", :js do + scenario "Show no_milestones text" do login_as(create(:user)) visit path diff --git a/spec/shared/system/nested_documentable.rb b/spec/shared/system/nested_documentable.rb index 1c616e167..9ac9d4b3d 100644 --- a/spec/shared/system/nested_documentable.rb +++ b/spec/shared/system/nested_documentable.rb @@ -26,7 +26,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should not show new document link when - documentable max documents allowed limit is reached", :js do + documentable max documents allowed limit is reached" do login_as user_to_login visit send(path, arguments) @@ -37,14 +37,14 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).not_to have_css "#new_document_link" end - scenario "Should not show max documents warning when no documents added", :js do + scenario "Should not show max documents warning when no documents added" do login_as user_to_login visit send(path, arguments) expect(page).not_to have_css ".max-documents-notice" end - scenario "Should show max documents warning when max documents allowed limit is reached", :js do + scenario "Should show max documents warning when max documents allowed limit is reached" do login_as user_to_login visit send(path, arguments) documentable.class.max_documents_allowed.times.each do @@ -55,7 +55,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).to have_content "Remove document" end - scenario "Should hide max documents warning after any document removal", :js do + scenario "Should hide max documents warning after any document removal" do login_as user_to_login visit send(path, arguments) @@ -68,7 +68,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).not_to have_css ".max-documents-notice" end - scenario "Should update nested document file name after choosing a file", :js do + scenario "Should update nested document file name after choosing a file" do login_as user_to_login visit send(path, arguments) @@ -88,7 +88,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should update nested document file title with - file name after choosing a file when no title defined", :js do + file name after choosing a file when no title defined" do login_as user_to_login visit send(path, arguments) @@ -98,7 +98,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should not update nested document file title with - file name after choosing a file when title already defined", :js do + file name after choosing a file when title already defined" do login_as user_to_login visit send(path, arguments) @@ -119,7 +119,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect_document_has_title(0, "My Title") end - scenario "Should update loading bar style after valid file upload", :js do + scenario "Should update loading bar style after valid file upload" do login_as user_to_login visit send(path, arguments) @@ -128,7 +128,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).to have_css ".loading-bar.complete" end - scenario "Should update loading bar style after invalid file upload", :js do + scenario "Should update loading bar style after invalid file upload" do login_as user_to_login visit send(path, arguments) @@ -140,7 +140,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).to have_css ".loading-bar.errors" end - scenario "Should update document cached_attachment field after valid file upload", :js do + scenario "Should update document cached_attachment field after valid file upload" do login_as user_to_login visit send(path, arguments) @@ -149,7 +149,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect_document_has_cached_attachment(0, ".pdf") end - scenario "Should not update document cached_attachment field after invalid file upload", :js do + scenario "Should not update document cached_attachment field after invalid file upload" do login_as user_to_login visit send(path, arguments) @@ -162,7 +162,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should show document errors after documentable submit with - empty document fields", :js do + empty document fields" do login_as user_to_login visit send(path, arguments) @@ -174,7 +174,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end end - scenario "Should delete document after valid file upload and click on remove button", :js do + scenario "Should delete document after valid file upload and click on remove button" do login_as user_to_login visit send(path, arguments) @@ -185,7 +185,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should show successful notice when - resource filled correctly without any nested documents", :js do + resource filled correctly without any nested documents" do login_as user_to_login visit send(path, arguments) @@ -196,7 +196,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should show successful notice when - resource filled correctly and after valid file uploads", :js do + resource filled correctly and after valid file uploads" do login_as user_to_login visit send(path, arguments) send(fill_resource_method_name) if fill_resource_method_name @@ -207,7 +207,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).to have_content documentable_success_notice end - scenario "Should show new document after successful creation with one uploaded file", :js do + scenario "Should show new document after successful creation with one uploaded file" do if documentable_factory_name == "dashboard_action" skip("Not render Documents count on dashboard_actions") end @@ -229,7 +229,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should show resource with new document after successful creation with - maximum allowed uploaded files", :js do + maximum allowed uploaded files" do if documentable_factory_name == "dashboard_action" skip("Not render Documents count on dashboard_actions") end @@ -258,7 +258,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na end scenario "Should not show add document button when - documentable has reached maximum of documents allowed", :js do + documentable has reached maximum of documents allowed" do create_list(:document, documentable.class.max_documents_allowed, documentable: documentable) login_as user_to_login visit send(path, arguments) @@ -266,7 +266,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).not_to have_css "#new_document_link" end - scenario "Should show add document button after destroy one document", :js do + scenario "Should show add document button after destroy one document" do create_list(:document, documentable.class.max_documents_allowed, documentable: documentable) login_as user_to_login visit send(path, arguments) @@ -278,7 +278,7 @@ shared_examples "nested documentable" do |login_as_name, documentable_factory_na expect(page).to have_css "#new_document_link" end - scenario "Should remove nested field after remove document", :js do + scenario "Should remove nested field after remove document" do create(:document, documentable: documentable) login_as user_to_login visit send(path, arguments) diff --git a/spec/shared/system/nested_imageable.rb b/spec/shared/system/nested_imageable.rb index 86caccb80..8f1048a2b 100644 --- a/spec/shared/system/nested_imageable.rb +++ b/spec/shared/system/nested_imageable.rb @@ -21,7 +21,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_selector "#new_image_link" end - scenario "Should hide new image link after adding one image", :js do + scenario "Should hide new image link after adding one image" do login_as user visit send(path, arguments) @@ -30,7 +30,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).not_to have_selector "#new_image_link" end - scenario "Should update nested image file name after choosing any file", :js do + scenario "Should update nested image file name after choosing any file" do login_as user visit send(path, arguments) @@ -45,7 +45,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_selector ".file-name", text: "clippy.jpg" end - scenario "Should update nested image file title with file name after choosing a file when no title defined", :js do + scenario "Should update nested image file title with file name after choosing a file when no title defined" do login_as user visit send(path, arguments) @@ -57,7 +57,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect_image_has_title("clippy.jpg") end - scenario "Should not update nested image file title with file name after choosing a file when title already defined", :js do + scenario "Should not update nested image file title with file name after choosing a file when title already defined" do login_as user visit send(path, arguments) @@ -78,7 +78,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p end end - scenario "Should update loading bar style after valid file upload", :js do + scenario "Should update loading bar style after valid file upload" do login_as user visit send(path, arguments) @@ -90,7 +90,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_selector ".loading-bar.complete" end - scenario "Should update loading bar style after invalid file upload", :js do + scenario "Should update loading bar style after invalid file upload" do login_as user visit send(path, arguments) @@ -103,7 +103,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_selector ".loading-bar.errors" end - scenario "Should update image cached_attachment field after valid file upload", :js do + scenario "Should update image cached_attachment field after valid file upload" do login_as user visit send(path, arguments) @@ -115,7 +115,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect_image_has_cached_attachment(".jpg") end - scenario "Should not update image cached_attachment field after invalid file upload", :js do + scenario "Should not update image cached_attachment field after invalid file upload" do login_as user visit send(path, arguments) @@ -128,7 +128,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect_image_has_cached_attachment("") end - scenario "Should show nested image errors after invalid form submit", :js do + scenario "Should show nested image errors after invalid form submit" do login_as user visit send(path, arguments) @@ -144,7 +144,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p end end - scenario "Should remove nested image after valid file upload and click on remove button", :js do + scenario "Should remove nested image after valid file upload and click on remove button" do login_as user visit send(path, arguments) @@ -160,7 +160,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).not_to have_selector("#nested-image .image") end - scenario "Should show successful notice when resource filled correctly without any nested images", :js do + scenario "Should show successful notice when resource filled correctly without any nested images" do if has_many_images skip "no need to test, there are no attributes for the parent resource" else @@ -173,7 +173,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p end end - scenario "Should show successful notice when resource filled correctly and after valid file uploads", :js do + scenario "Should show successful notice when resource filled correctly and after valid file uploads" do login_as user visit send(path, arguments) send(fill_resource_method_name) if fill_resource_method_name @@ -190,7 +190,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_content imageable_success_notice end - scenario "Should show new image after successful creation with one uploaded file", :js do + scenario "Should show new image after successful creation with one uploaded file" do login_as user visit send(path, arguments) send(fill_resource_method_name) if fill_resource_method_name @@ -222,7 +222,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).to have_css ".image", count: 1 end - scenario "Should not show add image button when image already exists", :js do + scenario "Should not show add image button when image already exists" do create(:image, imageable: imageable) login_as user visit send(path, arguments) @@ -230,7 +230,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).not_to have_css "a#new_image_link" end - scenario "Should remove nested field after remove image", :js do + scenario "Should remove nested field after remove image" do create(:image, imageable: imageable) login_as user visit send(path, arguments) @@ -239,7 +239,7 @@ shared_examples "nested imageable" do |imageable_factory_name, path, imageable_p expect(page).not_to have_css ".image" end - scenario "Should show add image button after remove image", :js do + scenario "Should show add image button after remove image" do create(:image, imageable: imageable) login_as user visit send(path, arguments) diff --git a/spec/shared/system/notifiable_in_app.rb b/spec/shared/system/notifiable_in_app.rb index 048eb81f0..c17b2166f 100644 --- a/spec/shared/system/notifiable_in_app.rb +++ b/spec/shared/system/notifiable_in_app.rb @@ -13,7 +13,7 @@ shared_examples "notifiable in-app" do |factory_name| expect(page).to have_link "You have a new notification" end - scenario "A user commented on my notifiable", :js do + scenario "A user commented on my notifiable" do notification = create(:notification, notifiable: notifiable, user: author) login_as author @@ -26,7 +26,7 @@ shared_examples "notifiable in-app" do |factory_name| expect(page).to have_xpath "//a[@href='#{notification_path(notification)}']" end - scenario "Multiple users commented on my notifiable", :js do + scenario "Multiple users commented on my notifiable" do 3.times do |n| login_as(create(:user, :verified)) @@ -48,7 +48,7 @@ shared_examples "notifiable in-app" do |factory_name| expect(page).to have_xpath "//a[@href='#{notification_path(Notification.last)}']" end - scenario "A user replied to my comment", :js do + scenario "A user replied to my comment" do comment = create :comment, commentable: notifiable, user: author login_as(create(:user, :verified)) @@ -73,7 +73,7 @@ shared_examples "notifiable in-app" do |factory_name| expect(page).to have_xpath "//a[@href='#{notification_path(Notification.last)}']" end - scenario "Multiple replies to my comment", :js do + scenario "Multiple replies to my comment" do comment = create :comment, commentable: notifiable, user: author 3.times do |n| @@ -100,7 +100,7 @@ shared_examples "notifiable in-app" do |factory_name| expect(page).to have_xpath "//a[@href='#{notification_path(Notification.last)}']" end - scenario "Author commented on his own notifiable", :js do + scenario "Author commented on his own notifiable" do login_as(author) visit path_for(notifiable) @@ -117,7 +117,7 @@ shared_examples "notifiable in-app" do |factory_name| end end - scenario "Author replied to his own comment", :js do + scenario "Author replied to his own comment" do comment = create :comment, commentable: notifiable, user: author login_as author diff --git a/spec/shared/system/progressable.rb b/spec/shared/system/progressable.rb index 8056a6f50..586be6678 100644 --- a/spec/shared/system/progressable.rb +++ b/spec/shared/system/progressable.rb @@ -1,5 +1,5 @@ shared_examples "progressable" do |factory_name| - describe "Progress bars", :js do + describe "Progress bars" do let!(:progressable) { create(factory_name) } let(:path) { polymorphic_path(progressable) } diff --git a/spec/shared/system/relationable.rb b/spec/shared/system/relationable.rb index bec05d1f2..7aee922c6 100644 --- a/spec/shared/system/relationable.rb +++ b/spec/shared/system/relationable.rb @@ -23,7 +23,7 @@ shared_examples "relationable" do |relationable_model_name| expect(page).not_to have_css("#related-content-list") end - scenario "related contents can be added", :js do + scenario "related contents can be added" do login_as(user) visit relationable.url @@ -86,7 +86,7 @@ shared_examples "relationable" do |relationable_model_name| expect(page).to have_content("Link not valid. You cannot relate a content to itself") end - scenario "related content can be scored positively", :js do + scenario "related content can be scored positively" do related_content = create(:related_content, parent_relationable: relationable, child_relationable: related1, author: build(:user)) login_as(user) @@ -102,7 +102,7 @@ shared_examples "relationable" do |relationable_model_name| expect(related_content.opposite_related_content.related_content_scores.find_by(user_id: user.id, related_content_id: related_content.opposite_related_content.id).value).to eq(1) end - scenario "related content can be scored negatively", :js do + scenario "related content can be scored negatively" do related_content = create(:related_content, parent_relationable: relationable, child_relationable: related1, author: build(:user)) login_as(user) diff --git a/spec/shared/system/remotely_translatable.rb b/spec/shared/system/remotely_translatable.rb index 478c9a049..0b277b22f 100644 --- a/spec/shared/system/remotely_translatable.rb +++ b/spec/shared/system/remotely_translatable.rb @@ -16,13 +16,13 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume end context "Button to request remote translation" do - scenario "should not be present when current locale translation exists", :js do + scenario "should not be present when current locale translation exists" do visit path expect(page).not_to have_button("Translate page") end - scenario "should be present when current locale translation does not exists", :js do + scenario "should be present when current locale translation does not exists" do visit path select("Español", from: "locale-switcher") @@ -30,7 +30,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).to have_button("Traducir página") end - scenario "should not be present when new current locale translation exists", :js do + scenario "should not be present when new current locale translation exists" do add_translations(resource, :es) visit path expect(page).not_to have_button("Translate page") @@ -40,7 +40,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).not_to have_button("Traducir página") end - scenario "should not be present when there are no resources to translate", :js do + scenario "should not be present when there are no resources to translate" do skip("only index_path") if show_path?(path_name) resource.destroy! visit path @@ -51,7 +51,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume end describe "with delayed job active", :delay_jobs do - scenario "should not be present when an equal RemoteTranslation is enqueued", :js do + scenario "should not be present when an equal RemoteTranslation is enqueued" do create(:remote_translation, remote_translatable: resource, locale: :es) visit path @@ -69,7 +69,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume end end - scenario "is not present when a resource translation exists but its comment has not tanslations", :js do + scenario "is not present when a resource translation exists but its comment has not tanslations" do add_translations(resource, :es) create(:comment, commentable: resource) visit path @@ -88,7 +88,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume end end - scenario "display when exists resource translations but the comment does not have a translation", :js do + scenario "display when exists resource translations but the comment does not have a translation" do add_translations(resource, :es) create(:comment, commentable: resource) visit path @@ -99,7 +99,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).to have_button("Traducir página") end - scenario "not display when exists resource translations but his comment has tanslations", :js do + scenario "not display when exists resource translations but his comment has tanslations" do add_translations(resource, :es) create_comment_with_translations(resource, :es) visit path @@ -114,7 +114,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume describe "should evaluate missing translations on featured_debates" do before { skip("only debates index path") if path_name != "debates_path" } - scenario "display when exists featured_debates without tanslations", :js do + scenario "display when exists featured_debates without tanslations" do add_translations(resource, :es) create_featured_debates visit path @@ -129,7 +129,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume describe "should evaluate missing translations on featured_proposals" do before { skip("only proposals index path") if path_name != "proposals_path" } - scenario "display when exists featured_proposals without tanslations", :js do + scenario "display when exists featured_proposals without tanslations" do add_translations(resource, :es) create_featured_proposals visit path @@ -144,7 +144,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume context "After click remote translations button" do describe "with delayed jobs", :delay_jobs do - scenario "the remote translation button should not be present", :js do + scenario "the remote translation button should not be present" do visit path select("Español", from: "locale-switcher") @@ -153,14 +153,14 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).not_to have_button("Traducir página") end - scenario "the remote translation is pending to translate", :js do + scenario "the remote translation is pending to translate" do visit path select("Español", from: "locale-switcher") expect { click_button "Traducir página" }.to change { RemoteTranslation.count }.from(0).to(1) end - scenario "should be present enqueued notice and informative text", :js do + scenario "should be present enqueued notice and informative text" do visit path select("Español", from: "locale-switcher") @@ -170,7 +170,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).to have_content("En un breve periodo de tiempo refrescando la página podrá ver todo el contenido en su idioma") end - scenario "should be present only informative text when user visit page with all content enqueued", :js do + scenario "should be present only informative text when user visit page with all content enqueued" do visit path select("Español", from: "locale-switcher") click_button "Traducir página" @@ -186,7 +186,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume end describe "without delayed jobs" do - scenario "the remote translation button should not be present", :js do + scenario "the remote translation button should not be present" do microsoft_translate_client_response = generate_response(resource) expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response) visit path @@ -197,7 +197,7 @@ shared_examples "remotely_translatable" do |factory_name, path_name, path_argume expect(page).not_to have_button("Traducir página") end - scenario "the remote translation has been translated and destoyed", :js do + scenario "the remote translation has been translated and destoyed" do microsoft_translate_client_response = generate_response(resource) expect_any_instance_of(RemoteTranslations::Microsoft::Client).to receive(:call).and_return(microsoft_translate_client_response) visit path diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index cb7e3486d..9bff58db0 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -53,10 +53,6 @@ RSpec.configure do |config| end config.before(:each, type: :system) do |example| - driven_by :rack_test - end - - config.before(:each, type: :system, js: true) do driven_by :headless_chrome end diff --git a/spec/system/admin/activity_spec.rb b/spec/system/admin/activity_spec.rb index f1e117586..6161fb5f5 100644 --- a/spec/system/admin/activity_spec.rb +++ b/spec/system/admin/activity_spec.rb @@ -8,7 +8,7 @@ describe "Admin activity" do end context "Proposals" do - scenario "Shows moderation activity on proposals", :js do + scenario "Shows moderation activity on proposals" do proposal = create(:proposal) visit proposal_path(proposal) @@ -27,7 +27,7 @@ describe "Admin activity" do end end - scenario "Shows moderation activity from moderation screen", :js do + scenario "Shows moderation activity from moderation screen" do proposal1 = create(:proposal) proposal2 = create(:proposal) proposal3 = create(:proposal) @@ -53,7 +53,7 @@ describe "Admin activity" do expect(page).to have_content(proposal3.title) end - scenario "Shows admin restores", :js do + scenario "Shows admin restores" do proposal = create(:proposal, :hidden) visit admin_hidden_proposals_path @@ -75,7 +75,7 @@ describe "Admin activity" do end context "Debates" do - scenario "Shows moderation activity on debates", :js do + scenario "Shows moderation activity on debates" do debate = create(:debate) visit debate_path(debate) @@ -94,7 +94,7 @@ describe "Admin activity" do end end - scenario "Shows moderation activity from moderation screen", :js do + scenario "Shows moderation activity from moderation screen" do debate1 = create(:debate) debate2 = create(:debate) debate3 = create(:debate) @@ -120,7 +120,7 @@ describe "Admin activity" do expect(page).to have_content(debate3.title) end - scenario "Shows admin restores", :js do + scenario "Shows admin restores" do debate = create(:debate, :hidden) visit admin_hidden_debates_path @@ -142,7 +142,7 @@ describe "Admin activity" do end context "Comments" do - scenario "Shows moderation activity on comments", :js do + scenario "Shows moderation activity on comments" do debate = create(:debate) comment = create(:comment, commentable: debate) @@ -162,7 +162,7 @@ describe "Admin activity" do end end - scenario "Shows moderation activity from moderation screen", :js do + scenario "Shows moderation activity from moderation screen" do comment1 = create(:comment, body: "SPAM") comment2 = create(:comment) comment3 = create(:comment, body: "Offensive!") @@ -188,7 +188,7 @@ describe "Admin activity" do expect(page).to have_content(comment3.body) end - scenario "Shows admin restores", :js do + scenario "Shows admin restores" do comment = create(:comment, :hidden) visit admin_hidden_comments_path @@ -210,7 +210,7 @@ describe "Admin activity" do end context "User" do - scenario "Shows moderation activity on users", :js do + scenario "Shows moderation activity on users" do proposal = create(:proposal) visit proposal_path(proposal) @@ -250,7 +250,7 @@ describe "Admin activity" do end end - scenario "Shows moderation activity from proposals moderation screen", :js do + scenario "Shows moderation activity from proposals moderation screen" do proposal1 = create(:proposal) proposal2 = create(:proposal) proposal3 = create(:proposal) @@ -278,7 +278,7 @@ describe "Admin activity" do expect(page).not_to have_content(proposal2.author.username) end - scenario "Shows moderation activity from debates moderation screen", :js do + scenario "Shows moderation activity from debates moderation screen" do debate1 = create(:debate) debate2 = create(:debate) debate3 = create(:debate) @@ -306,7 +306,7 @@ describe "Admin activity" do expect(page).not_to have_content(debate2.author.username) end - scenario "Shows moderation activity from comments moderation screen", :js do + scenario "Shows moderation activity from comments moderation screen" do comment1 = create(:comment, body: "SPAM") comment2 = create(:comment) comment3 = create(:comment, body: "Offensive!") @@ -334,7 +334,7 @@ describe "Admin activity" do expect(page).not_to have_content(comment2.author.username) end - scenario "Shows admin restores", :js do + scenario "Shows admin restores" do user = create(:user, :hidden) visit admin_hidden_users_path diff --git a/spec/system/admin/admin_notifications_spec.rb b/spec/system/admin/admin_notifications_spec.rb index 63199d1d0..4d8506f97 100644 --- a/spec/system/admin/admin_notifications_spec.rb +++ b/spec/system/admin/admin_notifications_spec.rb @@ -113,7 +113,7 @@ describe "Admin Notifications", :admin do end context "Destroy" do - scenario "A draft notification can be destroyed", :js do + scenario "A draft notification can be destroyed" do notification = create(:admin_notification) visit admin_admin_notifications_path @@ -180,8 +180,8 @@ describe "Admin Notifications", :admin do expect(page).to have_content error_message end - context "Send notification", :js do - scenario "A draft Admin notification can be sent", :js do + context "Send notification" do + scenario "A draft Admin notification can be sent" do 2.times { create(:user) } notification = create(:admin_notification, segment_recipient: :all_users) @@ -196,7 +196,7 @@ describe "Admin Notifications", :admin do end end - scenario "A sent Admin notification can not be sent", :js do + scenario "A sent Admin notification can not be sent" do notification = create(:admin_notification, :sent) visit admin_admin_notification_path(notification) @@ -204,7 +204,7 @@ describe "Admin Notifications", :admin do expect(page).not_to have_link("Send") end - scenario "Admin notification with invalid segment recipient cannot be sent", :js do + scenario "Admin notification with invalid segment recipient cannot be sent" do invalid_notification = create(:admin_notification) invalid_notification.update_column(:segment_recipient, "invalid_segment") visit admin_admin_notification_path(invalid_notification) diff --git a/spec/system/admin/administrators_spec.rb b/spec/system/admin/administrators_spec.rb index f64c99e3e..32d27ce37 100644 --- a/spec/system/admin/administrators_spec.rb +++ b/spec/system/admin/administrators_spec.rb @@ -18,7 +18,7 @@ describe "Admin administrators" do expect(page).not_to have_content user.name end - scenario "Create Administrator", :js do + scenario "Create Administrator" do fill_in "search", with: user.email click_button "Search" @@ -29,7 +29,7 @@ describe "Admin administrators" do end end - scenario "Delete Administrator", :js do + scenario "Delete Administrator" do within "#administrator_#{user_administrator.id}" do accept_confirm { click_link "Delete" } end @@ -39,7 +39,7 @@ describe "Admin administrators" do end end - scenario "Delete Administrator when its the current user", :js do + scenario "Delete Administrator when its the current user" do within "#administrator_#{admin.id}" do accept_confirm { click_link "Delete" } end @@ -101,7 +101,7 @@ describe "Admin administrators" do expect(page).not_to have_content(administrator1.email) end - scenario "Delete after searching", :js do + scenario "Delete after searching" do fill_in "Search user by name or email", with: administrator2.email click_button "Search" diff --git a/spec/system/admin/banners_spec.rb b/spec/system/admin/banners_spec.rb index 36f36c6ce..9e262169c 100644 --- a/spec/system/admin/banners_spec.rb +++ b/spec/system/admin/banners_spec.rb @@ -60,7 +60,7 @@ describe "Admin banners magement", :admin do end end - scenario "Publish a banner", :js do + scenario "Publish a banner" do visit admin_root_path within("#side_menu") do @@ -89,7 +89,7 @@ describe "Admin banners magement", :admin do expect(page).to have_link "Such banner many text wow link", href: "https://www.url.com" end - scenario "Publish a banner with a translation different than the current locale", :js do + scenario "Publish a banner with a translation different than the current locale" do visit new_admin_banner_path expect_to_have_language_selected "English" @@ -110,7 +110,7 @@ describe "Admin banners magement", :admin do expect(page).to have_field "Title", with: "En Français" end - scenario "Update banner color when changing from color picker or text_field", :js do + scenario "Update banner color when changing from color picker or text_field" do visit new_admin_banner_path fill_in "background_color_input", with: "#850000" @@ -121,7 +121,7 @@ describe "Admin banners magement", :admin do expect(find("#font_color_input").value).to eq("#ffb2b2") end - scenario "Edit banner with live refresh", :js do + scenario "Edit banner with live refresh" do create(:banner, title: "Hello", description: "Wrong text", target_url: "http://www.url.com", @@ -160,7 +160,7 @@ describe "Admin banners magement", :admin do expect(page).not_to have_content "Wrong text" end - scenario "Delete a banner", :js do + scenario "Delete a banner" do create(:banner, title: "Ugly banner", description: "Bad text", target_url: "http://www.url.com", diff --git a/spec/system/admin/budget_groups_spec.rb b/spec/system/admin/budget_groups_spec.rb index b7ef5f9b5..626af9503 100644 --- a/spec/system/admin/budget_groups_spec.rb +++ b/spec/system/admin/budget_groups_spec.rb @@ -55,7 +55,7 @@ describe "Admin budget groups", :admin do end end - scenario "Delete a group without headings", :js do + scenario "Delete a group without headings" do group = create(:budget_group, budget: budget) visit admin_budget_groups_path(budget) @@ -65,7 +65,7 @@ describe "Admin budget groups", :admin do expect(page).not_to have_selector "#budget_group_#{group.id}" end - scenario "Try to delete a group with headings", :js do + scenario "Try to delete a group with headings" do group = create(:budget_group, budget: budget) create(:budget_heading, group: group) @@ -122,7 +122,7 @@ describe "Admin budget groups", :admin do expect(page).to have_field "Maximum number of headings in which a user can select projects", with: "2" end - scenario "Changing name for current locale will update the slug if budget is in draft phase", :js do + scenario "Changing name for current locale will update the slug if budget is in draft phase" do group = create(:budget_group, budget: budget) old_slug = group.slug diff --git a/spec/system/admin/budget_headings_spec.rb b/spec/system/admin/budget_headings_spec.rb index dec38f663..2f166a413 100644 --- a/spec/system/admin/budget_headings_spec.rb +++ b/spec/system/admin/budget_headings_spec.rb @@ -60,7 +60,7 @@ describe "Admin budget headings", :admin do end end - scenario "Delete a heading without investments", :js do + scenario "Delete a heading without investments" do heading = create(:budget_heading, group: group) visit admin_budget_group_headings_path(budget, group) @@ -70,7 +70,7 @@ describe "Admin budget headings", :admin do expect(page).not_to have_selector "#budget_heading_#{heading.id}" end - scenario "Try to delete a heading with investments", :js do + scenario "Try to delete a heading with investments" do heading = create(:budget_heading, group: group, name: "Atlantis") create(:budget_investment, heading: heading) @@ -119,7 +119,7 @@ describe "Admin budget headings", :admin do expect(page).to have_content "can't be blank" end - describe "Max votes is optional", :js do + describe "Max votes is optional" do scenario "do no show max_ballot_lines field for knapsack budgets" do visit new_admin_budget_group_heading_path(budget, group) @@ -159,7 +159,7 @@ describe "Admin budget headings", :admin do expect(find_field("Allow content block")).not_to be_checked end - scenario "Changing name for current locale will update the slug if budget is in draft phase", :js do + scenario "Changing name for current locale will update the slug if budget is in draft phase" do heading = create(:budget_heading, group: group) old_slug = heading.slug diff --git a/spec/system/admin/budget_investments_spec.rb b/spec/system/admin/budget_investments_spec.rb index c1a5c38f3..a85b3e1c0 100644 --- a/spec/system/admin/budget_investments_spec.rb +++ b/spec/system/admin/budget_investments_spec.rb @@ -83,7 +83,7 @@ describe "Admin budget investments", :admin do end end - scenario "Filtering by budget heading", :js do + scenario "Filtering by budget heading" do group1 = create(:budget_group, name: "Streets", budget: budget) group2 = create(:budget_group, name: "Parks", budget: budget) @@ -130,7 +130,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_link("Plant trees") end - scenario "Filtering by admin", :js do + scenario "Filtering by admin" do user = create(:user, username: "Admin 1") user2 = create(:user, username: "Admin 2") administrator = create(:administrator, user: user) @@ -173,7 +173,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Realocate visitors") end - scenario "Filtering by valuator", :js do + scenario "Filtering by valuator" do user = create(:user) valuator = create(:valuator, user: user, description: "Valuator 1") budget.valuators = [valuator] @@ -206,7 +206,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Realocate visitors") end - scenario "Filtering by valuator group", :js do + scenario "Filtering by valuator group" do health_group = create(:valuator_group, name: "Health") culture_group = create(:valuator_group, name: "Culture") @@ -239,7 +239,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_link("Build a hospital") end - scenario "Filtering by without assigned admin", :js do + scenario "Filtering by without assigned admin" do create(:budget_investment, title: "Investment without admin", budget: budget) @@ -268,7 +268,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Investment with admin") end - scenario "Filtering by without assigned valuator", :js do + scenario "Filtering by without assigned valuator" do user = create(:user) valuator = create(:valuator, user: user) create(:budget_investment, @@ -299,7 +299,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Investment with valuator") end - scenario "Filtering by under valuation", :js do + scenario "Filtering by under valuation" do user = create(:user) valuator = create(:valuator, user: user) create(:budget_investment, @@ -333,7 +333,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Investment with valuation") end - scenario "Filtering by valuation finished", :js do + scenario "Filtering by valuation finished" do create(:budget_investment, title: "Investment valuation open", budget: budget) @@ -362,7 +362,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Investment valuation finished") end - scenario "Filtering by winners", :js do + scenario "Filtering by winners" do create(:budget_investment, :winner, :finished, @@ -514,7 +514,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_select("tag_name", options: ["All tags", "Accessibility"]) end - scenario "Disable 'Calculate winner' button if incorrect phase", :js do + scenario "Disable 'Calculate winner' button if incorrect phase" do budget.update!(phase: "reviewing_ballots") visit admin_budget_budget_investments_path(budget) @@ -550,7 +550,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_link "Calculate Winner Investments" end - scenario "Filtering by minimum number of votes", :js do + scenario "Filtering by minimum number of votes" do group_1 = create(:budget_group, budget: budget) group_2 = create(:budget_group, budget: budget) parks = create(:budget_heading, group: group_1) @@ -586,7 +586,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_link("Road 100 supports") end - scenario "Filtering by maximum number of votes", :js do + scenario "Filtering by maximum number of votes" do group_1 = create(:budget_group, budget: budget) group_2 = create(:budget_group, budget: budget) parks = create(:budget_heading, group: group_1) @@ -622,7 +622,7 @@ describe "Admin budget investments", :admin do expect(page).to have_link("Road 100 supports") end - scenario "Combination of checkbox with text search", :js do + scenario "Combination of checkbox with text search" do user = create(:user, username: "Admin 1") administrator = create(:administrator, user: user) budget.administrators = [administrator] @@ -660,7 +660,7 @@ describe "Admin budget investments", :admin do expect(page).to have_content("Selected") end - scenario "Combination of select with text search", :js do + scenario "Combination of select with text search" do create(:budget_investment, :feasible, :finished, budget: budget, title: "Educate the children") create(:budget_investment, :feasible, :finished, budget: budget, title: "More schools") create(:budget_investment, budget: budget, title: "More hospitals") @@ -694,7 +694,7 @@ describe "Admin budget investments", :admin do expect(page).to have_content("Selected") end - scenario "Combination of checkbox with text search and checkbox", :js do + scenario "Combination of checkbox with text search and checkbox" do user = create(:user, username: "Admin 1") administrator = create(:administrator, user: user) budget.administrators = [administrator] @@ -808,7 +808,7 @@ describe "Admin budget investments", :admin do end end - context "Sorting", :js do + context "Sorting" do before do create(:budget_investment, title: "B First Investment", budget: budget, cached_votes_up: 50) create(:budget_investment, title: "A Second Investment", budget: budget, cached_votes_up: 25) @@ -935,7 +935,7 @@ describe "Admin budget investments", :admin do end context "Show" do - scenario "Show the investment details", :js do + scenario "Show the investment details" do user = create(:user, username: "Rachel", email: "rachel@valuators.org") valuator = create(:valuator, user: user) budget_investment = create(:budget_investment, @@ -969,7 +969,7 @@ describe "Admin budget investments", :admin do end end - scenario "Show image and documents on investment details", :js do + scenario "Show image and documents on investment details" do budget_investment = create(:budget_investment, :with_image, :unfeasible, @@ -1014,7 +1014,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_content("Hide") end - scenario "If budget is finished, investment cannot be edited or valuation comments created", :js do + scenario "If budget is finished, investment cannot be edited or valuation comments created" do finished_budget = create(:budget, :finished) budget_investment = create(:budget_investment, budget: finished_budget, @@ -1033,7 +1033,7 @@ describe "Admin budget investments", :admin do end context "Edit" do - scenario "Change title, incompatible, description or heading", :js do + scenario "Change title, incompatible, description or heading" do budget_investment = create(:budget_investment, :incompatible) create(:budget_heading, group: budget_investment.group, name: "Barbate") @@ -1066,7 +1066,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_content "Mark as incompatible" end - scenario "Add administrator", :js do + scenario "Add administrator" do budget_investment = create(:budget_investment) user = create(:user, username: "Marta", email: "marta@admins.org") create(:administrator, user: user, description: "Marta desc") @@ -1087,7 +1087,7 @@ describe "Admin budget investments", :admin do expect(page).to have_content "Assigned administrator: Marta" end - scenario "Add valuators", :js do + scenario "Add valuators" do budget_investment = create(:budget_investment) user1 = create(:user, username: "Valentina", email: "v1@valuators.org") @@ -1172,7 +1172,7 @@ describe "Admin budget investments", :admin do end end - scenario "Adds existing valuation tags", :js do + scenario "Adds existing valuation tags" do budget_investment1 = create(:budget_investment) budget_investment1.set_tag_list_on(:valuation_tags, "Education, Health") budget_investment1.save! @@ -1261,7 +1261,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_content "Refugees, Solidarity" end - scenario "Shows alert when 'Valuation finished' is checked", :js do + scenario "Shows alert when 'Valuation finished' is checked" do budget_investment = create(:budget_investment) visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) @@ -1276,7 +1276,7 @@ describe "Admin budget investments", :admin do # The feature tested in this scenario works as expected but some underlying reason # we're not aware of makes it fail at random - xscenario "Shows alert with unfeasible status when 'Valuation finished' is checked", :js do + xscenario "Shows alert with unfeasible status when 'Valuation finished' is checked" do budget_investment = create(:budget_investment, :unfeasible) visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) @@ -1289,7 +1289,7 @@ describe "Admin budget investments", :admin do expect(valuation).to be_checked end - scenario "Undoes check in 'Valuation finished' if user clicks 'cancel' on alert", :js do + scenario "Undoes check in 'Valuation finished' if user clicks 'cancel' on alert" do budget_investment = create(:budget_investment) visit admin_budget_budget_investment_path(budget_investment.budget, budget_investment) @@ -1356,7 +1356,7 @@ describe "Admin budget investments", :admin do create(:budget_investment, :undecided, budget: budget, title: "Undecided project") end - scenario "Filtering by valuation and selection", :js do + scenario "Filtering by valuation and selection" do visit admin_budget_budget_investments_path(budget) click_link "Advanced filters" @@ -1401,7 +1401,7 @@ describe "Admin budget investments", :admin do expect(page).to have_content(winner_bi.title) end - scenario "Aggregating results", :js do + scenario "Aggregating results" do visit admin_budget_budget_investments_path(budget) click_link "Advanced filters" @@ -1427,7 +1427,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_content(feasible_vf_bi.title) end - scenario "Showing the selection buttons", :js do + scenario "Showing the selection buttons" do visit admin_budget_budget_investments_path(budget) within("#budget_investment_#{unfeasible_bi.id}") do @@ -1477,7 +1477,7 @@ describe "Admin budget investments", :admin do end end - scenario "Selecting an investment", :js do + scenario "Selecting an investment" do visit admin_budget_budget_investments_path(budget) within("#budget_investment_#{feasible_vf_bi.id}") do @@ -1496,7 +1496,7 @@ describe "Admin budget investments", :admin do end end - scenario "Unselecting an investment", :js do + scenario "Unselecting an investment" do visit admin_budget_budget_investments_path(budget) click_link "Advanced filters" @@ -1526,7 +1526,7 @@ describe "Admin budget investments", :admin do describe "Pagination" do before { selected_bi.update(cached_votes_up: 50) } - scenario "After unselecting an investment", :js do + scenario "After unselecting an investment" do allow(Budget::Investment).to receive(:default_per_page).and_return(3) visit admin_budget_budget_investments_path(budget) @@ -1553,7 +1553,7 @@ describe "Admin budget investments", :admin do let(:investment1) { create(:budget_investment, heading: heading) } let(:investment2) { create(:budget_investment, heading: heading) } - scenario "Mark as visible to valuator", :js do + scenario "Mark as visible to valuator" do investment1.valuators << valuator investment2.valuators << valuator investment1.update!(administrator: admin) @@ -1600,7 +1600,7 @@ describe "Admin budget investments", :admin do expect(page).not_to have_content investment2.title end - scenario "Unmark as visible to valuator", :js do + scenario "Unmark as visible to valuator" do budget.update!(phase: "valuating") investment1.valuators << valuator @@ -1676,7 +1676,7 @@ describe "Admin budget investments", :admin do end end - scenario "Keeps the valuation tags", :js do + scenario "Keeps the valuation tags" do investment1.set_tag_list_on(:valuation_tags, %w[Possimpible Truthiness]) investment1.save! @@ -1770,7 +1770,7 @@ describe "Admin budget investments", :admin do valuation_finished visible_to_valuators selected] end - scenario "Display default columns", :js do + scenario "Display default columns" do visit admin_budget_budget_investments_path(budget) within("table.column-selectable") do @@ -1783,7 +1783,7 @@ describe "Admin budget investments", :admin do end end - scenario "Display incompatible column as default if selected filter was set", :js do + scenario "Display incompatible column as default if selected filter was set" do visit admin_budget_budget_investments_path(budget, advanced_filters: ["selected"]) within("table.column-selectable") do @@ -1793,7 +1793,7 @@ describe "Admin budget investments", :admin do expect(page).to have_content(investment.title) end - scenario "Set cookie with default columns value if undefined", :js do + scenario "Set cookie with default columns value if undefined" do visit admin_budget_budget_investments_path(budget) cookies = page.driver.browser.manage.all_cookies @@ -1804,7 +1804,7 @@ describe "Admin budget investments", :admin do "feasibility,price,valuation_finished,visible_to_valuators,selected,incompatible") end - scenario "Use column selector to display visible columns", :js do + scenario "Use column selector to display visible columns" do visit admin_budget_budget_investments_path(budget) click_button "Columns" @@ -1834,7 +1834,7 @@ describe "Admin budget investments", :admin do end end - scenario "Cookie will be updated after change columns selection", :js do + scenario "Cookie will be updated after change columns selection" do visit admin_budget_budget_investments_path(budget) click_button "Columns" @@ -1863,7 +1863,7 @@ describe "Admin budget investments", :admin do "visible_to_valuators,selected,incompatible,author") end - scenario "Select an investment when some columns are not displayed", :js do + scenario "Select an investment when some columns are not displayed" do investment.update!(title: "Don't display me, please!") visit admin_budget_budget_investments_path(budget) @@ -1878,7 +1878,7 @@ describe "Admin budget investments", :admin do end end - scenario "When restoring the page from browser history renders columns selectors only once", :js do + scenario "When restoring the page from browser history renders columns selectors only once" do visit admin_budget_budget_investments_path(budget) click_link "Proposals" diff --git a/spec/system/admin/budget_phases_spec.rb b/spec/system/admin/budget_phases_spec.rb index 4a25f89b2..ce5c22c1c 100644 --- a/spec/system/admin/budget_phases_spec.rb +++ b/spec/system/admin/budget_phases_spec.rb @@ -4,7 +4,7 @@ describe "Admin budget phases" do let(:budget) { create(:budget) } context "Edit", :admin do - scenario "Update phase", :js do + scenario "Update phase" do visit edit_admin_budget_budget_phase_path(budget, budget.current_phase) fill_in "start_date", with: Date.current + 1.day diff --git a/spec/system/admin/budgets_spec.rb b/spec/system/admin/budgets_spec.rb index 0e835ef77..7d4aac56c 100644 --- a/spec/system/admin/budgets_spec.rb +++ b/spec/system/admin/budgets_spec.rb @@ -26,7 +26,7 @@ describe "Admin budgets", :admin do expect(page).to have_content "Accepting projects" end - scenario "Filters by phase", :js do + scenario "Filters by phase" do drafting_budget = create(:budget, :drafting) accepting_budget = create(:budget, :accepting) selecting_budget = create(:budget, :selecting) @@ -94,7 +94,7 @@ describe "Admin budgets", :admin do expect(page).to have_select "Final voting style", selected: "Knapsack" end - scenario "Create budget - Approval voting", :js do + scenario "Create budget - Approval voting" do admin = Administrator.first visit admin_budgets_path @@ -134,7 +134,7 @@ describe "Admin budgets", :admin do expect(page).to have_css("small.form-error", text: "has already been taken") end - scenario "Do not show results and stats settings on new budget", :js do + scenario "Do not show results and stats settings on new budget" do visit new_admin_budget_path expect(page).not_to have_content "Show results and stats" @@ -144,7 +144,7 @@ describe "Admin budgets", :admin do end end - context "Create", :js do + context "Create" do scenario "A new budget is always created in draft mode" do visit admin_budgets_path click_link "Create new budget" @@ -161,7 +161,7 @@ describe "Admin budgets", :admin do end end - context "Publish", :js do + context "Publish" do let(:budget) { create(:budget, :drafting) } scenario "Can preview budget before it is published" do @@ -275,7 +275,7 @@ describe "Admin budgets", :admin do end end - scenario "Show results and stats settings", :js do + scenario "Show results and stats settings" do visit edit_admin_budget_path(budget) within_fieldset "Show results and stats" do @@ -285,7 +285,7 @@ describe "Admin budgets", :admin do end end - scenario "Changing name for current locale will update the slug if budget is in draft phase", :js do + scenario "Changing name for current locale will update the slug if budget is in draft phase" do budget.update!(published: false) old_slug = budget.slug @@ -321,7 +321,7 @@ describe "Admin budgets", :admin do expect(page).to have_current_path(admin_budgets_path) end - scenario "Deselect all selected staff", :js do + scenario "Deselect all selected staff" do admin = Administrator.first valuator = create(:valuator) @@ -347,7 +347,7 @@ describe "Admin budgets", :admin do end context "Calculate Budget's Winner Investments" do - scenario "For a Budget in reviewing balloting", :js do + scenario "For a Budget in reviewing balloting" do budget = create(:budget, :reviewing_ballots) heading = create(:budget_heading, budget: budget, price: 4) unselected = create(:budget_investment, :unselected, heading: heading, price: 1, diff --git a/spec/system/admin/dashboard/actions_spec.rb b/spec/system/admin/dashboard/actions_spec.rb index 5032d3e0c..3bb101142 100644 --- a/spec/system/admin/dashboard/actions_spec.rb +++ b/spec/system/admin/dashboard/actions_spec.rb @@ -46,7 +46,7 @@ describe "Admin dashboard actions", :admin do click_link "Create resource or action" end - scenario "Creates a new action", :js do + scenario "Creates a new action" do fill_in "Title", with: action.title fill_in_ckeditor "Description", with: action.description @@ -93,7 +93,7 @@ describe "Admin dashboard actions", :admin do visit admin_dashboard_actions_path end - scenario "deletes the action", js: true do + scenario "deletes the action" do page.accept_confirm do click_link "Delete" end @@ -101,7 +101,7 @@ describe "Admin dashboard actions", :admin do expect(page).not_to have_content(action.title) end - scenario "can not delete actions that have been executed", js: true do + scenario "can not delete actions that have been executed" do _executed_action = create(:dashboard_executed_action, action: action) page.accept_confirm do diff --git a/spec/system/admin/emails/emails_download_spec.rb b/spec/system/admin/emails/emails_download_spec.rb index e7e4183e9..26facab75 100644 --- a/spec/system/admin/emails/emails_download_spec.rb +++ b/spec/system/admin/emails/emails_download_spec.rb @@ -39,7 +39,7 @@ describe "Admin download user emails" do end end - scenario "Download button is not disabled after being clicked", :js do + scenario "Download button is not disabled after being clicked" do visit admin_emails_download_index_path click_button "Download emails list" diff --git a/spec/system/admin/emails/newsletters_spec.rb b/spec/system/admin/emails/newsletters_spec.rb index 05bc3f7d8..d58ddd8f1 100644 --- a/spec/system/admin/emails/newsletters_spec.rb +++ b/spec/system/admin/emails/newsletters_spec.rb @@ -58,7 +58,7 @@ describe "Admin newsletter emails", :admin do end end - scenario "Create", :js do + scenario "Create" do visit admin_newsletters_path click_link "New newsletter" @@ -76,7 +76,7 @@ describe "Admin newsletter emails", :admin do expect(page).to have_content "This is a body" end - scenario "Update", :js do + scenario "Update" do newsletter = create(:newsletter) visit admin_newsletters_path @@ -98,7 +98,7 @@ describe "Admin newsletter emails", :admin do expect(page).to have_content "This is a body" end - scenario "Destroy", :js do + scenario "Destroy" do newsletter = create(:newsletter) visit admin_newsletters_path @@ -128,8 +128,8 @@ describe "Admin newsletter emails", :admin do expect(page).to have_content error_message end - context "Send newsletter", :js do - scenario "Sends newsletter emails", :js do + context "Send newsletter" do + scenario "Sends newsletter emails" do newsletter = create(:newsletter) visit admin_newsletter_path(newsletter) @@ -138,7 +138,7 @@ describe "Admin newsletter emails", :admin do expect(page).to have_content "Newsletter sent successfully" end - scenario "Invalid newsletter cannot be sent", :js do + scenario "Invalid newsletter cannot be sent" do invalid_newsletter = create(:newsletter) invalid_newsletter.update_column(:segment_recipient, "invalid_segment") visit admin_newsletter_path(invalid_newsletter) @@ -147,7 +147,7 @@ describe "Admin newsletter emails", :admin do end end - context "Counter of emails sent", :js do + context "Counter of emails sent" do scenario "Display counter" do newsletter = create(:newsletter, segment_recipient: "administrators") visit admin_newsletter_path(newsletter) @@ -161,7 +161,7 @@ describe "Admin newsletter emails", :admin do end end - scenario "Select list of users to send newsletter", :js do + scenario "Select list of users to send newsletter" do UserSegments::SEGMENTS.each do |user_segment| visit new_admin_newsletter_path diff --git a/spec/system/admin/feature_flags_spec.rb b/spec/system/admin/feature_flags_spec.rb index e2891e9cc..c114b87e0 100644 --- a/spec/system/admin/feature_flags_spec.rb +++ b/spec/system/admin/feature_flags_spec.rb @@ -5,7 +5,7 @@ describe "Admin feature flags", :admin do Setting["process.budgets"] = true end - scenario "Enabled features are listed on menu", :js do + scenario "Enabled features are listed on menu" do visit admin_root_path within("#side_menu") do @@ -14,7 +14,7 @@ describe "Admin feature flags", :admin do end end - scenario "Disable a participatory process", :show_exceptions, :js do + scenario "Disable a participatory process", :show_exceptions do setting = Setting.find_by(key: "process.budgets") budget = create(:budget) @@ -44,7 +44,7 @@ describe "Admin feature flags", :admin do expect(page).to have_content "Internal server error" end - scenario "Enable a disabled participatory process", :js do + scenario "Enable a disabled participatory process" do Setting["process.budgets"] = nil setting = Setting.find_by(key: "process.budgets") @@ -71,7 +71,7 @@ describe "Admin feature flags", :admin do end end - scenario "Disable a feature", :js do + scenario "Disable a feature" do setting = Setting.find_by(key: "feature.twitter_login") visit admin_settings_path @@ -92,7 +92,7 @@ describe "Admin feature flags", :admin do end end - scenario "Enable a disabled feature", :js do + scenario "Enable a disabled feature" do setting = Setting.find_by(key: "feature.map") visit admin_settings_path diff --git a/spec/system/admin/geozones_spec.rb b/spec/system/admin/geozones_spec.rb index e5d87d830..5d1ac9018 100644 --- a/spec/system/admin/geozones_spec.rb +++ b/spec/system/admin/geozones_spec.rb @@ -11,7 +11,7 @@ describe "Admin geozones", :admin do expect(page).to have_content(retiro.name) end - scenario "Create new geozone", :js do + scenario "Create new geozone" do visit admin_root_path within("#side_menu") do @@ -69,7 +69,7 @@ describe "Admin geozones", :admin do end end - scenario "Delete geozone with no associated elements", :js do + scenario "Delete geozone with no associated elements" do geozone = create(:geozone, name: "Delete me!") visit admin_geozones_path @@ -81,7 +81,7 @@ describe "Admin geozones", :admin do expect(Geozone.where(id: geozone.id)).to be_empty end - scenario "Delete geozone with associated element", :js do + scenario "Delete geozone with associated element" do geozone = create(:geozone, name: "Delete me!") create(:proposal, geozone: geozone) diff --git a/spec/system/admin/hidden_budget_investments_spec.rb b/spec/system/admin/hidden_budget_investments_spec.rb index 0c4b6664d..74abe5b9b 100644 --- a/spec/system/admin/hidden_budget_investments_spec.rb +++ b/spec/system/admin/hidden_budget_investments_spec.rb @@ -13,7 +13,7 @@ describe "Admin hidden budget investments", :admin do expect(page).to have_content(investment.description) end - scenario "Restore", :js do + scenario "Restore" do investment = create(:budget_investment, :hidden, heading: heading) visit admin_hidden_budget_investments_path @@ -78,7 +78,7 @@ describe "Admin hidden budget investments", :admin do expect(page).to have_content("Confirmed investment") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(Budget::Investment).to receive(:default_per_page).and_return(2) 4.times { create(:budget_investment, :hidden, :with_confirmed_hide, heading: heading) } diff --git a/spec/system/admin/hidden_comments_spec.rb b/spec/system/admin/hidden_comments_spec.rb index 4c7f114c8..1d0b4114c 100644 --- a/spec/system/admin/hidden_comments_spec.rb +++ b/spec/system/admin/hidden_comments_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin hidden comments", :admin do - scenario "Do not show comments from blocked users", :js do + scenario "Do not show comments from blocked users" do comment = create(:comment, :hidden, body: "SPAM from SPAMMER") proposal = create(:proposal, author: comment.author) create(:comment, commentable: proposal, user: comment.author, body: "Good Proposal!") @@ -63,7 +63,7 @@ describe "Admin hidden comments", :admin do expect(page).not_to have_link("This is SPAM comment on proposal") end - scenario "Restore", :js do + scenario "Restore" do comment = create(:comment, :hidden, body: "Not really SPAM") visit admin_hidden_comments_path @@ -123,7 +123,7 @@ describe "Admin hidden comments", :admin do expect(page).to have_content("Confirmed comment") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(Comment).to receive(:default_per_page).and_return(2) 4.times { create(:comment, :hidden, :with_confirmed_hide) } diff --git a/spec/system/admin/hidden_debates_spec.rb b/spec/system/admin/hidden_debates_spec.rb index a7ef9f327..e38d704f5 100644 --- a/spec/system/admin/hidden_debates_spec.rb +++ b/spec/system/admin/hidden_debates_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -describe "Admin hidden debates", :admin, :js do +describe "Admin hidden debates", :admin do scenario "Restore" do debate = create(:debate, :hidden) visit admin_hidden_debates_path @@ -65,7 +65,7 @@ describe "Admin hidden debates", :admin, :js do expect(page).to have_content("Confirmed debate") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(Debate).to receive(:default_per_page).and_return(2) 4.times { create(:debate, :hidden, :with_confirmed_hide) } diff --git a/spec/system/admin/hidden_proposals_spec.rb b/spec/system/admin/hidden_proposals_spec.rb index 0fe000230..6d281e25f 100644 --- a/spec/system/admin/hidden_proposals_spec.rb +++ b/spec/system/admin/hidden_proposals_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin hidden proposals", :admin do - scenario "List shows all relevant info", :js do + scenario "List shows all relevant info" do proposal = create(:proposal, :hidden) visit admin_hidden_proposals_path @@ -14,7 +14,7 @@ describe "Admin hidden proposals", :admin do expect(page).to have_content(proposal.video_url) end - scenario "Restore", :js do + scenario "Restore" do proposal = create(:proposal, :hidden) visit admin_hidden_proposals_path @@ -78,7 +78,7 @@ describe "Admin hidden proposals", :admin do expect(page).to have_content("Confirmed proposal") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(Proposal).to receive(:default_per_page).and_return(2) 4.times { create(:proposal, :hidden, :with_confirmed_hide) } diff --git a/spec/system/admin/hidden_users_spec.rb b/spec/system/admin/hidden_users_spec.rb index 8e51edaca..09d6cb102 100644 --- a/spec/system/admin/hidden_users_spec.rb +++ b/spec/system/admin/hidden_users_spec.rb @@ -17,7 +17,7 @@ describe "Admin hidden users", :admin do expect(page).to have_content(comment2.body) end - scenario "Restore", :js do + scenario "Restore" do user = create(:user, :hidden) visit admin_hidden_users_path @@ -76,7 +76,7 @@ describe "Admin hidden users", :admin do expect(page).to have_content("Confirmed user") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(User).to receive(:default_per_page).and_return(2) 4.times { create(:user, :hidden, :with_confirmed_hide) } diff --git a/spec/system/admin/homepage/homepage_spec.rb b/spec/system/admin/homepage/homepage_spec.rb index 2c60341fe..3783002a8 100644 --- a/spec/system/admin/homepage/homepage_spec.rb +++ b/spec/system/admin/homepage/homepage_spec.rb @@ -26,7 +26,7 @@ describe "Homepage", :admin do end context "Feeds" do - scenario "Proposals", :js do + scenario "Proposals" do 5.times { create(:proposal) } visit admin_homepage_path @@ -46,7 +46,7 @@ describe "Homepage", :admin do expect(page).not_to have_css("#feed_proposals.medium-8") end - scenario "Debates", :js do + scenario "Debates" do 5.times { create(:debate) } visit admin_homepage_path @@ -65,7 +65,7 @@ describe "Homepage", :admin do expect(page).not_to have_css("#feed_debates.medium-4") end - scenario "Proposals and debates", :js do + scenario "Proposals and debates" do 3.times { create(:proposal) } 3.times { create(:debate) } @@ -94,7 +94,7 @@ describe "Homepage", :admin do end end - scenario "Processes", :js do + scenario "Processes" do 5.times { create(:legislation_process) } visit admin_homepage_path @@ -112,7 +112,7 @@ describe "Homepage", :admin do xscenario "Deactivate" end - scenario "Cards", :js do + scenario "Cards" do card1 = create(:widget_card, label: "Card1 label", title: "Card1 text", description: "Card1 description", diff --git a/spec/system/admin/legislation/draft_versions_spec.rb b/spec/system/admin/legislation/draft_versions_spec.rb index 14e6a9fd5..0f41cd823 100644 --- a/spec/system/admin/legislation/draft_versions_spec.rb +++ b/spec/system/admin/legislation/draft_versions_spec.rb @@ -18,7 +18,7 @@ describe "Admin legislation draft versions", :admin do end context "Create" do - scenario "Valid legislation draft version", :js do + scenario "Valid legislation draft version" do create(:legislation_process, title: "An example legislation process") visit admin_root_path @@ -47,7 +47,7 @@ describe "Admin legislation draft versions", :admin do end context "Update" do - scenario "Valid legislation draft version", :js do + scenario "Valid legislation draft version" do process = create(:legislation_process, title: "An example legislation process") create(:legislation_draft_version, title: "Version 1", process: process) @@ -75,7 +75,7 @@ describe "Admin legislation draft versions", :admin do end end - context "Changing content with the markdown editor", :js do + context "Changing content with the markdown editor" do let(:prompt) { "You've edited the text without saving it. Do you confirm to leave the page?" } let(:version) { create(:legislation_draft_version, body: "Version 1") } let(:path) do diff --git a/spec/system/admin/legislation/processes_spec.rb b/spec/system/admin/legislation/processes_spec.rb index 27651b28a..4b0e54817 100644 --- a/spec/system/admin/legislation/processes_spec.rb +++ b/spec/system/admin/legislation/processes_spec.rb @@ -163,7 +163,7 @@ describe "Admin collaborative legislation", :admin do expect(page).not_to have_content "Describing the process" end - scenario "Create a legislation process with an image", :js do + scenario "Create a legislation process with an image" do visit new_admin_legislation_process_path fill_in "Process Title", with: "An example legislation process" fill_in "Summary", with: "Summary of the process" @@ -251,7 +251,7 @@ describe "Admin collaborative legislation", :admin do expect(page).not_to have_content "Draft publication" end - scenario "Enabling/disabling a phase enables/disables its date fields", :js do + scenario "Enabling/disabling a phase enables/disables its date fields" do process.update!(published: false) visit edit_admin_legislation_process_path(process) @@ -273,7 +273,7 @@ describe "Admin collaborative legislation", :admin do expect(page).to have_field "end_date", disabled: false, with: "2008-08-08" end - scenario "Enabling/disabling a phase does not enable/disable another phase date fields", :js do + scenario "Enabling/disabling a phase does not enable/disable another phase date fields" do process.update!(draft_phase_enabled: false, draft_publication_enabled: false) visit edit_admin_legislation_process_path(process) @@ -309,7 +309,7 @@ describe "Admin collaborative legislation", :admin do expect(page).to have_field("Categories", with: "bicycles, pollution, recycling") end - scenario "Edit milestones summary", :js do + scenario "Edit milestones summary" do visit admin_legislation_process_milestones_path(process) expect(page).not_to have_link "Remove language" @@ -353,7 +353,7 @@ describe "Admin collaborative legislation", :admin do Setting["sdg.process.legislation"] = true end - scenario "create Collaborative Legislation with sdg related list", :js do + scenario "create Collaborative Legislation with sdg related list" do visit new_admin_legislation_process_path fill_in "Process Title", with: "Legislation process with SDG related content" within_fieldset "Process" do @@ -370,7 +370,7 @@ describe "Admin collaborative legislation", :admin do end end - scenario "edit Collaborative Legislation with sdg related list", :js do + scenario "edit Collaborative Legislation with sdg related list" do process = create(:legislation_process, title: "Legislation process with SDG related content") process.sdg_goals = [SDG::Goal[1], SDG::Goal[17]] visit edit_admin_legislation_process_path(process) diff --git a/spec/system/admin/legislation/proposals_spec.rb b/spec/system/admin/legislation/proposals_spec.rb index d1662f665..ff8fad6b9 100644 --- a/spec/system/admin/legislation/proposals_spec.rb +++ b/spec/system/admin/legislation/proposals_spec.rb @@ -15,7 +15,7 @@ describe "Admin collaborative legislation", :admin do end end - scenario "Selecting legislation proposals", :js do + scenario "Selecting legislation proposals" do proposal = create(:legislation_proposal, cached_votes_score: 10) visit admin_legislation_process_proposals_path(proposal.legislation_process_id) @@ -26,7 +26,7 @@ describe "Admin collaborative legislation", :admin do end end - scenario "Sorting legislation proposals by title", js: true do + scenario "Sorting legislation proposals by title" do process = create(:legislation_process) create(:legislation_proposal, title: "bbbb", legislation_process_id: process.id) create(:legislation_proposal, title: "aaaa", legislation_process_id: process.id) @@ -42,7 +42,7 @@ describe "Admin collaborative legislation", :admin do end end - scenario "Sorting legislation proposals by supports", js: true do + scenario "Sorting legislation proposals by supports" do process = create(:legislation_process) create(:legislation_proposal, cached_votes_score: 10, legislation_process_id: process.id) create(:legislation_proposal, cached_votes_score: 30, legislation_process_id: process.id) @@ -58,7 +58,7 @@ describe "Admin collaborative legislation", :admin do end end - scenario "Sorting legislation proposals by Id", js: true do + scenario "Sorting legislation proposals by Id" do process = create(:legislation_process) proposal1 = create(:legislation_proposal, title: "bbbb", legislation_process_id: process.id) proposal2 = create(:legislation_proposal, title: "aaaa", legislation_process_id: process.id) diff --git a/spec/system/admin/legislation/questions_spec.rb b/spec/system/admin/legislation/questions_spec.rb index 8d9bcc5bb..5c3ec810b 100644 --- a/spec/system/admin/legislation/questions_spec.rb +++ b/spec/system/admin/legislation/questions_spec.rb @@ -41,7 +41,7 @@ describe "Admin legislation questions", :admin do end context "Update" do - scenario "Valid legislation question", :js do + scenario "Valid legislation question" do create(:legislation_question, title: "Question 2", process: process) visit admin_root_path @@ -66,7 +66,7 @@ describe "Admin legislation questions", :admin do end context "Delete" do - scenario "Legislation question", :js do + scenario "Legislation question" do create(:legislation_question, title: "Question 1", process: process) question = create(:legislation_question, title: "Question 2", process: process) question_option = create(:legislation_question_option, question: question, value: "Yes") @@ -100,7 +100,7 @@ describe "Admin legislation questions", :admin do end end - scenario "Edit an existing option", :js do + scenario "Edit an existing option" do create(:legislation_question_option, question: question, value: "Original") visit edit_question_url @@ -113,7 +113,7 @@ describe "Admin legislation questions", :admin do expect(page).to have_field(field_en[:id], with: "Changed") end - scenario "Remove an option", :js do + scenario "Remove an option" do create(:legislation_question_option, question: question, value: "Yes") create(:legislation_question_option, question: question, value: "No") @@ -139,7 +139,7 @@ describe "Admin legislation questions", :admin do question.update!(title_en: "Title in English", title_es: "Título en Español") end - scenario "Add translation for question option", :js do + scenario "Add translation for question option" do visit edit_question_url click_on "Add option" @@ -160,7 +160,7 @@ describe "Admin legislation questions", :admin do expect(page).to have_field(field_es[:id], with: "Opción 1") end - scenario "Add new question option after changing active locale", :js do + scenario "Add new question option after changing active locale" do visit edit_question_url select "Español", from: :select_language diff --git a/spec/system/admin/local_census_records_spec.rb b/spec/system/admin/local_census_records_spec.rb index 3699b7477..9cd79d412 100644 --- a/spec/system/admin/local_census_records_spec.rb +++ b/spec/system/admin/local_census_records_spec.rb @@ -57,7 +57,7 @@ describe "Admin local census records", :admin do expect(page).not_to have_content local_census_record.document_number end - scenario "Should show matching records by document number", :js do + scenario "Should show matching records by document number" do visit admin_local_census_records_path fill_in :search, with: "X66777888" @@ -134,7 +134,7 @@ describe "Admin local census records", :admin do let!(:local_census_record) { create(:local_census_record) } let!(:deleted_document_number) { local_census_record.document_number } - scenario "Should show successful destroy notice", :js do + scenario "Should show successful destroy notice" do visit admin_local_census_records_path expect(page).to have_content deleted_document_number diff --git a/spec/system/admin/managers_spec.rb b/spec/system/admin/managers_spec.rb index 56c902cdb..8178187f0 100644 --- a/spec/system/admin/managers_spec.rb +++ b/spec/system/admin/managers_spec.rb @@ -14,7 +14,7 @@ describe "Admin managers", :admin do expect(page).not_to have_content user.name end - scenario "Create Manager", :js do + scenario "Create Manager" do fill_in "search", with: user.email click_button "Search" @@ -25,7 +25,7 @@ describe "Admin managers", :admin do end end - scenario "Delete Manager", :js do + scenario "Delete Manager" do accept_confirm { click_link "Delete" } within("#managers") do @@ -82,7 +82,7 @@ describe "Admin managers", :admin do expect(page).not_to have_content(manager1.email) end - scenario "Delete after searching", :js do + scenario "Delete after searching" do fill_in "Search user by name or email", with: manager2.email click_button "Search" diff --git a/spec/system/admin/milestone_statuses_spec.rb b/spec/system/admin/milestone_statuses_spec.rb index 9436b57bd..104f3f8d5 100644 --- a/spec/system/admin/milestone_statuses_spec.rb +++ b/spec/system/admin/milestone_statuses_spec.rb @@ -72,7 +72,7 @@ describe "Admin milestone statuses", :admin do end context "Delete" do - scenario "Hides status", :js do + scenario "Hides status" do status = create(:milestone_status) visit admin_milestone_statuses_path diff --git a/spec/system/admin/moderators_spec.rb b/spec/system/admin/moderators_spec.rb index 70ad342ae..b9946d29b 100644 --- a/spec/system/admin/moderators_spec.rb +++ b/spec/system/admin/moderators_spec.rb @@ -14,7 +14,7 @@ describe "Admin moderators", :admin do expect(page).not_to have_content user.name end - scenario "Create Moderator", :js do + scenario "Create Moderator" do fill_in "search", with: user.email click_button "Search" @@ -25,7 +25,7 @@ describe "Admin moderators", :admin do end end - scenario "Delete Moderator", :js do + scenario "Delete Moderator" do accept_confirm { click_link "Delete" } within("#moderators") do @@ -82,7 +82,7 @@ describe "Admin moderators", :admin do expect(page).not_to have_content(moderator1.email) end - scenario "Delete after searching", :js do + scenario "Delete after searching" do fill_in "Search user by name or email", with: moderator2.email click_button "Search" diff --git a/spec/system/admin/poll/active_polls_spec.rb b/spec/system/admin/poll/active_polls_spec.rb index 64ea97702..2f332b5f2 100644 --- a/spec/system/admin/poll/active_polls_spec.rb +++ b/spec/system/admin/poll/active_polls_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin Active polls", :admin do - scenario "Add", :js do + scenario "Add" do expect(ActivePoll.first).to be nil visit admin_polls_path @@ -14,7 +14,7 @@ describe "Admin Active polls", :admin do expect(ActivePoll.first.description).to eq "
Active polls description
\r\n" end - scenario "Edit", :js do + scenario "Edit" do create(:active_poll, description_en: "Old description") visit polls_path diff --git a/spec/system/admin/poll/booth_assigments_spec.rb b/spec/system/admin/poll/booth_assigments_spec.rb index ee1576450..cfddd6e08 100644 --- a/spec/system/admin/poll/booth_assigments_spec.rb +++ b/spec/system/admin/poll/booth_assigments_spec.rb @@ -5,7 +5,7 @@ describe "Admin booths assignments", :admin do let!(:poll) { create(:poll) } let!(:booth) { create(:poll_booth) } - scenario "List Polls and Booths to manage", :js do + scenario "List Polls and Booths to manage" do second_poll = create(:poll) second_booth = create(:poll_booth) @@ -24,7 +24,7 @@ describe "Admin booths assignments", :admin do expect(page).to have_content(second_booth.name) end - scenario "Does not hide the Polls menu", :js do + scenario "Does not hide the Polls menu" do visit booth_assignments_admin_polls_path within("#admin_menu") { expect(page).to have_link "Polls" } @@ -40,7 +40,7 @@ describe "Admin booths assignments", :admin do expect(page).not_to have_content "Poll from user's proposal" end - scenario "Assign booth to poll", :js do + scenario "Assign booth to poll" do visit admin_poll_path(poll) within("#poll-resources") do click_link "Booths (0)" @@ -77,7 +77,7 @@ describe "Admin booths assignments", :admin do expect(page).to have_content booth.name end - scenario "Unassign booth from poll", :js do + scenario "Unassign booth from poll" do create(:poll_booth_assignment, poll: poll, booth: booth) visit admin_poll_path(poll) @@ -116,7 +116,7 @@ describe "Admin booths assignments", :admin do expect(page).not_to have_content booth.name end - scenario "Unassing booth whith associated shifts", :js do + scenario "Unassing booth whith associated shifts" do officer = create(:poll_officer) create(:poll_officer_assignment, officer: officer, poll: poll, booth: booth) create(:poll_shift, booth: booth, officer: officer) @@ -207,7 +207,7 @@ describe "Admin booths assignments", :admin do end end - scenario "Doesn't show system recounts for old polls", :js do + scenario "Doesn't show system recounts for old polls" do poll = create(:poll, :old) booth_assignment = create(:poll_booth_assignment, poll: poll) diff --git a/spec/system/admin/poll/booths_spec.rb b/spec/system/admin/poll/booths_spec.rb index b369f0ad0..19051b9fa 100644 --- a/spec/system/admin/poll/booths_spec.rb +++ b/spec/system/admin/poll/booths_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin booths", :admin do - scenario "Index empty", :js do + scenario "Index empty" do visit admin_root_path within("#side_menu") do @@ -12,7 +12,7 @@ describe "Admin booths", :admin do expect(page).to have_content "There are no active booths for any upcoming poll." end - scenario "Index", :js do + scenario "Index" do 3.times { create(:poll_booth) } visit admin_root_path @@ -32,7 +32,7 @@ describe "Admin booths", :admin do expect(page).not_to have_content "There are no booths" end - scenario "Available", :js do + scenario "Available" do booth_for_current_poll = create(:poll_booth, polls: [create(:poll, :current)]) booth_for_expired_poll = create(:poll_booth, polls: [create(:poll, :expired)]) diff --git a/spec/system/admin/poll/officer_assignments_spec.rb b/spec/system/admin/poll/officer_assignments_spec.rb index df91b1241..af1846dfb 100644 --- a/spec/system/admin/poll/officer_assignments_spec.rb +++ b/spec/system/admin/poll/officer_assignments_spec.rb @@ -19,7 +19,7 @@ describe "Officer Assignments", :admin do end end - scenario "Search", :js do + scenario "Search" do poll = create(:poll) create(:poll_officer, name: "John Snow", polls: [poll]) diff --git a/spec/system/admin/poll/officers_spec.rb b/spec/system/admin/poll/officers_spec.rb index 18773655b..4bedd0800 100644 --- a/spec/system/admin/poll/officers_spec.rb +++ b/spec/system/admin/poll/officers_spec.rb @@ -14,7 +14,7 @@ describe "Admin poll officers", :admin do expect(page).not_to have_content user.name end - scenario "Create", :js do + scenario "Create" do fill_in "search", with: user.email click_button "Search" @@ -25,7 +25,7 @@ describe "Admin poll officers", :admin do end end - scenario "Delete", :js do + scenario "Delete" do accept_confirm { click_link "Delete position" } expect(page).not_to have_css "#officers" diff --git a/spec/system/admin/poll/polls_spec.rb b/spec/system/admin/poll/polls_spec.rb index 79473210d..8848fa96e 100644 --- a/spec/system/admin/poll/polls_spec.rb +++ b/spec/system/admin/poll/polls_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin polls", :admin do - scenario "Index empty", :js do + scenario "Index empty" do visit admin_root_path click_link "Polls" @@ -9,7 +9,7 @@ describe "Admin polls", :admin do expect(page).to have_content "There are no polls" end - scenario "Index show polls list order by starts at date", :js do + scenario "Index show polls list order by starts at date" do poll_1 = create(:poll, name: "Poll first", starts_at: 15.days.ago) poll_2 = create(:poll, name: "Poll second", starts_at: 1.month.ago) poll_3 = create(:poll, name: "Poll third", starts_at: 2.days.ago) @@ -110,7 +110,7 @@ describe "Admin polls", :admin do end context "Destroy" do - scenario "Can destroy poll without questions", :js do + scenario "Can destroy poll without questions" do poll = create(:poll) visit admin_polls_path @@ -123,7 +123,7 @@ describe "Admin polls", :admin do expect(page).to have_content("There are no polls.") end - scenario "Can destroy poll with questions and answers", :js do + scenario "Can destroy poll with questions and answers" do poll = create(:poll, name: "Do you support CONSUL?") create(:poll_question, :yes_no, poll: poll) @@ -140,7 +140,7 @@ describe "Admin polls", :admin do expect(Poll::Question::Answer.count).to eq(0) end - scenario "Can destroy polls with answers including videos", :js do + scenario "Can destroy polls with answers including videos" do poll = create(:poll, name: "Do you support CONSUL?") create(:poll_answer_video, poll: poll) @@ -153,7 +153,7 @@ describe "Admin polls", :admin do expect(page).to have_content "Poll deleted successfully" end - scenario "Can't destroy poll with votes", :js do + scenario "Can't destroy poll with votes" do poll = create(:poll) create(:poll_question, poll: poll) create(:poll_voter, :from_booth, :valid_document, poll: poll) @@ -201,7 +201,7 @@ describe "Admin polls", :admin do context "Officers" do context "Poll show" do - scenario "No officers", :js do + scenario "No officers" do poll = create(:poll) visit admin_poll_path(poll) click_link "Officers (0)" @@ -209,7 +209,7 @@ describe "Admin polls", :admin do expect(page).to have_content "There are no officers assigned to this poll" end - scenario "Officer list", :js do + scenario "Officer list" do poll = create(:poll) booth = create(:poll_booth, polls: [poll]) @@ -237,7 +237,7 @@ describe "Admin polls", :admin do context "Questions" do context "Poll show" do - scenario "Question list", :js do + scenario "Question list" do poll = create(:poll) question = create(:poll_question, poll: poll) other_question = create(:poll_question) @@ -254,7 +254,7 @@ describe "Admin polls", :admin do context "Recounting" do context "Poll show" do - scenario "No recounts", :js do + scenario "No recounts" do poll = create(:poll) visit admin_poll_path(poll) click_link "Recounting" @@ -262,7 +262,7 @@ describe "Admin polls", :admin do expect(page).to have_content "There is nothing to be recounted" end - scenario "Recounts list", :js do + scenario "Recounts list" do poll = create(:poll) booth_assignment = create(:poll_booth_assignment, poll: poll) booth_assignment_recounted = create(:poll_booth_assignment, poll: poll) @@ -342,7 +342,7 @@ describe "Admin polls", :admin do context "Results" do context "Poll show" do - scenario "No results", :js do + scenario "No results" do poll = create(:poll) visit admin_poll_path(poll) click_link "Results" @@ -425,7 +425,7 @@ describe "Admin polls", :admin do expect(page).not_to have_content "Results by booth" end - scenario "Results by answer", :js do + scenario "Results by answer" do poll = create(:poll) booth_assignment_1 = create(:poll_booth_assignment, poll: poll) booth_assignment_2 = create(:poll_booth_assignment, poll: poll) @@ -523,7 +523,7 @@ describe "Admin polls", :admin do Setting["sdg.process.polls"] = true end - scenario "create poll with sdg related list", :js do + scenario "create poll with sdg related list" do visit new_admin_poll_path fill_in "Name", with: "Upcoming poll with SDG related content" fill_in "Start Date", with: 1.week.from_now @@ -540,7 +540,7 @@ describe "Admin polls", :admin do end end - scenario "edit poll with sdg related list", :js do + scenario "edit poll with sdg related list" do poll = create(:poll, name: "Upcoming poll with SDG related content") poll.sdg_goals = [SDG::Goal[1], SDG::Goal[17]] visit edit_admin_poll_path(poll) diff --git a/spec/system/admin/poll/questions/answers/answers_spec.rb b/spec/system/admin/poll/questions/answers/answers_spec.rb index 70e526e34..262ed7d7f 100644 --- a/spec/system/admin/poll/questions/answers/answers_spec.rb +++ b/spec/system/admin/poll/questions/answers/answers_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Answers", :admin do - scenario "Create", :js do + scenario "Create" do question = create(:poll_question) visit admin_question_path(question) @@ -16,7 +16,7 @@ describe "Answers", :admin do expect(page).to have_content "The Hitchhiker's Guide To The Universe" end - scenario "Create second answer and place after the first one", :js do + scenario "Create second answer and place after the first one" do question = create(:poll_question) create(:poll_question_answer, title: "First", question: question, given_order: 1) @@ -54,7 +54,7 @@ describe "Answers", :admin do expect("Another title").to appear_before("New title") end - scenario "Reorder", :js do + scenario "Reorder" do question = create(:poll_question) create(:poll_question_answer, question: question, title: "First", given_order: 1) create(:poll_question_answer, question: question, title: "Last", given_order: 2) diff --git a/spec/system/admin/poll/questions/answers/documents/documents_spec.rb b/spec/system/admin/poll/questions/answers/documents/documents_spec.rb index 9fb2094c6..4c1fff164 100644 --- a/spec/system/admin/poll/questions/answers/documents/documents_spec.rb +++ b/spec/system/admin/poll/questions/answers/documents/documents_spec.rb @@ -21,7 +21,7 @@ describe "Documents", :admin do end end - scenario "Remove document from answer", :js do + scenario "Remove document from answer" do answer = create(:poll_question_answer) document = create(:document, documentable: answer) diff --git a/spec/system/admin/poll/questions/answers/images/images_spec.rb b/spec/system/admin/poll/questions/answers/images/images_spec.rb index 7536f50a6..b54396477 100644 --- a/spec/system/admin/poll/questions/answers/images/images_spec.rb +++ b/spec/system/admin/poll/questions/answers/images/images_spec.rb @@ -30,7 +30,7 @@ describe "Images", :admin do end end - scenario "Add image to answer", :js do + scenario "Add image to answer" do answer = create(:poll_question_answer) image = create(:image) @@ -46,7 +46,7 @@ describe "Images", :admin do expect(page).to have_content("clippy.jpg") end - scenario "Remove image from answer", :js do + scenario "Remove image from answer" do answer = create(:poll_question_answer) image = create(:image, imageable: answer) diff --git a/spec/system/admin/poll/questions_spec.rb b/spec/system/admin/poll/questions_spec.rb index 09dfd7e75..b94c2701d 100644 --- a/spec/system/admin/poll/questions_spec.rb +++ b/spec/system/admin/poll/questions_spec.rb @@ -134,7 +134,7 @@ describe "Admin poll questions", :admin do expect(page).not_to have_content(old_title) end - scenario "Destroy", :js do + scenario "Destroy" do poll = create(:poll) question1 = create(:poll_question, poll: poll) question2 = create(:poll_question, poll: poll) @@ -152,7 +152,7 @@ describe "Admin poll questions", :admin do pending "Mark all city by default when creating a poll question from a successful proposal" context "Poll select box" do - scenario "translates the poll name in options", :js do + scenario "translates the poll name in options" do poll = create(:poll, name_en: "Name in English", name_es: "Nombre en Español") proposal = create(:proposal) @@ -167,7 +167,7 @@ describe "Admin poll questions", :admin do options: ["Seleccionar votación", poll.name_es]) end - scenario "uses fallback if name is not translated to current locale", :js do + scenario "uses fallback if name is not translated to current locale" do unless globalize_french_fallbacks.first == :es skip("Spec only useful when French falls back to Spanish") end diff --git a/spec/system/admin/poll/shifts_spec.rb b/spec/system/admin/poll/shifts_spec.rb index 11e3d41e1..c7fcaf788 100644 --- a/spec/system/admin/poll/shifts_spec.rb +++ b/spec/system/admin/poll/shifts_spec.rb @@ -25,7 +25,7 @@ describe "Admin shifts", :admin do expect(page).to have_content officer.email end - scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date", :js do + scenario "Create Vote Collection Shift and Recount & Scrutiny Shift on same date" do create(:poll) poll = create(:poll, :current) booth = create(:poll_booth, polls: [poll, create(:poll, :expired)]) @@ -88,7 +88,7 @@ describe "Admin shifts", :admin do end end - scenario "Vote Collection Shift and Recount & Scrutiny Shift don't include already assigned dates to officer", :js do + scenario "Vote Collection Shift and Recount & Scrutiny Shift don't include already assigned dates to officer" do poll = create(:poll, :current) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) @@ -120,7 +120,7 @@ describe "Admin shifts", :admin do expect(page).to have_select("shift_date_recount_scrutiny_date", options: ["Select day", *recount_scrutiny_dates]) end - scenario "Change option from Recount & Scrutinity to Collect Votes", :js do + scenario "Change option from Recount & Scrutinity to Collect Votes" do booth = create(:poll_booth) officer = create(:poll_officer) @@ -138,7 +138,7 @@ describe "Admin shifts", :admin do expect(page).to have_select("shift_date_vote_collection_date", options: ["Voting days ended"]) end - scenario "Error on create", :js do + scenario "Error on create" do poll = create(:poll, :current) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) @@ -159,7 +159,7 @@ describe "Admin shifts", :admin do expect(page).to have_content "A date must be selected" end - scenario "Destroy", :js do + scenario "Destroy" do poll = create(:poll, :current) booth = create(:poll_booth, polls: [poll]) officer = create(:poll_officer) @@ -181,7 +181,7 @@ describe "Admin shifts", :admin do expect(page).to have_css(".shift", count: 0) end - scenario "Try to destroy with associated recount", :js do + scenario "Try to destroy with associated recount" do assignment = create(:poll_booth_assignment) officer_assignment = create(:poll_officer_assignment, booth_assignment: assignment) create(:poll_recount, booth_assignment: assignment, officer_assignment: officer_assignment) @@ -206,7 +206,7 @@ describe "Admin shifts", :admin do expect(page).to have_css(".shift", count: 1) end - scenario "try to destroy with associated partial results", :js do + scenario "try to destroy with associated partial results" do assignment = create(:poll_booth_assignment) officer_assignment = create(:poll_officer_assignment, booth_assignment: assignment) create(:poll_partial_result, diff --git a/spec/system/admin/proposal_notifications_spec.rb b/spec/system/admin/proposal_notifications_spec.rb index b90025c3c..21b81f71b 100644 --- a/spec/system/admin/proposal_notifications_spec.rb +++ b/spec/system/admin/proposal_notifications_spec.rb @@ -9,7 +9,7 @@ describe "Admin proposal notifications", :admin do expect(page).to have_content(proposal_notification.body) end - scenario "Restore", :js do + scenario "Restore" do proposal_notification = create(:proposal_notification, :hidden, created_at: Date.current - 5.days) visit admin_hidden_proposal_notifications_path @@ -74,7 +74,7 @@ describe "Admin proposal notifications", :admin do expect(page).to have_content("Confirmed notification") end - scenario "Action links remember the pagination setting and the filter", :js do + scenario "Action links remember the pagination setting and the filter" do allow(ProposalNotification).to receive(:default_per_page).and_return(2) 4.times { create(:proposal_notification, :hidden, :with_confirmed_hide) } diff --git a/spec/system/admin/proposals_spec.rb b/spec/system/admin/proposals_spec.rb index 2c5ed2d52..055f47d6c 100644 --- a/spec/system/admin/proposals_spec.rb +++ b/spec/system/admin/proposals_spec.rb @@ -23,7 +23,7 @@ describe "Admin proposals", :admin do expect(page).not_to have_content "Build a monument" end - scenario "Select a proposal", :js do + scenario "Select a proposal" do proposal = create(:proposal) visit admin_proposals_path @@ -34,7 +34,7 @@ describe "Admin proposals", :admin do expect(proposal.reload.selected?).to be true end - scenario "Unselect a proposal", :js do + scenario "Unselect a proposal" do proposal = create(:proposal, :selected) visit admin_proposals_path diff --git a/spec/system/admin/sdg/managers_spec.rb b/spec/system/admin/sdg/managers_spec.rb index 0f893e79b..3830b259a 100644 --- a/spec/system/admin/sdg/managers_spec.rb +++ b/spec/system/admin/sdg/managers_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -describe "Admin SDG managers", :js do +describe "Admin SDG managers" do let!(:user) { create(:user) } let!(:sdg_manager) { create(:sdg_manager) } diff --git a/spec/system/admin/settings_spec.rb b/spec/system/admin/settings_spec.rb index c15c71e3d..4c06b9251 100644 --- a/spec/system/admin/settings_spec.rb +++ b/spec/system/admin/settings_spec.rb @@ -26,7 +26,7 @@ describe "Admin settings", :admin do expect(page).to have_content "Value updated" end - describe "Map settings initialization", :js do + describe "Map settings initialization" do before do Setting["feature.map"] = true end @@ -84,7 +84,7 @@ describe "Admin settings", :admin do expect(page).to have_content "Map configuration updated succesfully" end - scenario "Should display marker by default", :js do + scenario "Should display marker by default" do Setting["feature.map"] = true visit admin_settings_path @@ -93,7 +93,7 @@ describe "Admin settings", :admin do expect(find("#longitude", visible: :hidden).value).to eq "0.0" end - scenario "Should update marker", :js do + scenario "Should update marker" do Setting["feature.map"] = true visit admin_settings_path @@ -109,7 +109,7 @@ describe "Admin settings", :admin do end describe "Update content types" do - scenario "stores the correct mime types", :js do + scenario "stores the correct mime types" do Setting["uploads.images.content_types"] = "image/png" setting = Setting.find_by!(key: "uploads.images.content_types") @@ -172,7 +172,7 @@ describe "Admin settings", :admin do Setting["feature.remote_census"] = true end - scenario "On #tab-remote-census-configuration", :js do + scenario "On #tab-remote-census-configuration" do remote_census_setting = create(:setting, key: "remote_census.general.whatever") visit admin_settings_path @@ -188,7 +188,7 @@ describe "Admin settings", :admin do end end - scenario "On #tab-configuration", :js do + scenario "On #tab-configuration" do configuration_setting = Setting.create!(key: "whatever") visit admin_settings_path @@ -208,7 +208,7 @@ describe "Admin settings", :admin do Setting["feature.map"] = true end - scenario "On #tab-map-configuration", :js do + scenario "On #tab-map-configuration" do map_setting = Setting.create!(key: "map.whatever") visit admin_settings_path @@ -224,7 +224,7 @@ describe "Admin settings", :admin do end end - scenario "On #tab-proposals", :js do + scenario "On #tab-proposals" do proposal_dashboard_setting = Setting.create!(key: "proposals.whatever") visit admin_settings_path @@ -239,7 +239,7 @@ describe "Admin settings", :admin do expect(page).to have_css("div#tab-proposals.is-active") end - scenario "On #tab-participation-processes", :js do + scenario "On #tab-participation-processes" do process_setting = Setting.create!(key: "process.whatever") visit admin_settings_path @@ -253,7 +253,7 @@ describe "Admin settings", :admin do expect(page).to have_css("div#tab-participation-processes.is-active") end - scenario "On #tab-feature-flags", :js do + scenario "On #tab-feature-flags" do feature_setting = Setting.create!(key: "feature.whatever") visit admin_settings_path @@ -267,7 +267,7 @@ describe "Admin settings", :admin do expect(page).to have_css("div#tab-feature-flags.is-active") end - scenario "On #tab-sdg-configuration", :js do + scenario "On #tab-sdg-configuration" do Setting["feature.sdg"] = true Setting.create!(key: "sdg.whatever") login_as(create(:administrator).user) @@ -285,7 +285,7 @@ describe "Admin settings", :admin do end describe "Skip verification" do - scenario "deactivate skip verification", :js do + scenario "deactivate skip verification" do Setting["feature.user.skip_verification"] = "true" setting = Setting.find_by(key: "feature.user.skip_verification") @@ -299,7 +299,7 @@ describe "Admin settings", :admin do expect(page).to have_content "Value updated" end - scenario "activate skip verification", :js do + scenario "activate skip verification" do Setting["feature.user.skip_verification"] = nil setting = Setting.find_by(key: "feature.user.skip_verification") @@ -316,7 +316,7 @@ describe "Admin settings", :admin do end end - describe "SDG configuration tab", :js do + describe "SDG configuration tab" do scenario "is enabled when the sdg feature is enabled" do Setting["feature.sdg"] = true login_as(create(:administrator).user) diff --git a/spec/system/admin/site_customization/content_blocks_spec.rb b/spec/system/admin/site_customization/content_blocks_spec.rb index 9831a4202..7b9bceadd 100644 --- a/spec/system/admin/site_customization/content_blocks_spec.rb +++ b/spec/system/admin/site_customization/content_blocks_spec.rb @@ -13,7 +13,7 @@ describe "Admin custom content blocks", :admin do end context "Create" do - scenario "Valid custom block", :js do + scenario "Valid custom block" do visit admin_root_path within("#side_menu") do @@ -36,7 +36,7 @@ describe "Admin custom content blocks", :admin do expect(page).to have_content "Some custom content" end - scenario "Invalid custom block", :js do + scenario "Invalid custom block" do create(:site_customization_content_block) visit admin_root_path @@ -63,7 +63,7 @@ describe "Admin custom content blocks", :admin do end context "Update" do - scenario "Valid custom block", :js do + scenario "Valid custom block" do create(:site_customization_content_block) visit admin_root_path @@ -84,7 +84,7 @@ describe "Admin custom content blocks", :admin do end context "Delete" do - scenario "From index page", :js do + scenario "From index page" do block = create(:site_customization_content_block) visit admin_site_customization_content_blocks_path diff --git a/spec/system/admin/site_customization/documents_spec.rb b/spec/system/admin/site_customization/documents_spec.rb index 237887ff3..21d8d5ea0 100644 --- a/spec/system/admin/site_customization/documents_spec.rb +++ b/spec/system/admin/site_customization/documents_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Documents", :admin do - scenario "Navigation", :js do + scenario "Navigation" do visit admin_root_path within("#side_menu") do @@ -68,7 +68,7 @@ describe "Documents", :admin do expect(page).to have_content "Invalid document" end - scenario "Destroy", :js do + scenario "Destroy" do document = create(:document, :admin) visit admin_site_customization_documents_path diff --git a/spec/system/admin/site_customization/images_spec.rb b/spec/system/admin/site_customization/images_spec.rb index e6f87e044..26f1b13c4 100644 --- a/spec/system/admin/site_customization/images_spec.rb +++ b/spec/system/admin/site_customization/images_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Admin custom images", :admin do - scenario "Upload valid png image", :js do + scenario "Upload valid png image" do visit admin_root_path within("#side_menu") do diff --git a/spec/system/admin/site_customization/information_texts_spec.rb b/spec/system/admin/site_customization/information_texts_spec.rb index b6b6865e3..5ee3d0e5f 100644 --- a/spec/system/admin/site_customization/information_texts_spec.rb +++ b/spec/system/admin/site_customization/information_texts_spec.rb @@ -51,7 +51,7 @@ describe "Admin custom information texts", :admin do end context "Globalization" do - scenario "Add a translation", :js do + scenario "Add a translation" do key = "debates.index.section_footer.title" visit admin_site_customization_information_texts_path @@ -70,7 +70,7 @@ describe "Admin custom information texts", :admin do expect(page).not_to have_content "Aide sur les débats" end - scenario "Update a translation", :js do + scenario "Update a translation" do key = "proposals.show.share" create(:i18n_content, key: key, value_fr: "Partager la proposition") @@ -89,7 +89,7 @@ describe "Admin custom information texts", :admin do expect(page).not_to have_content "Partager la proposition" end - scenario "Remove a translation", :js do + scenario "Remove a translation" do first_key = "debates.form.debate_title" debate_title = create(:i18n_content, key: first_key, value_en: "Custom debate title", diff --git a/spec/system/admin/site_customization/pages_spec.rb b/spec/system/admin/site_customization/pages_spec.rb index 30083cc42..ff9039c37 100644 --- a/spec/system/admin/site_customization/pages_spec.rb +++ b/spec/system/admin/site_customization/pages_spec.rb @@ -29,7 +29,7 @@ describe "Admin custom pages", :admin do end context "Create" do - scenario "Valid custom page", :js do + scenario "Valid custom page" do visit admin_root_path within("#side_menu") do @@ -59,7 +59,7 @@ describe "Admin custom pages", :admin do create(:site_customization_page, title: "An example custom page", slug: "custom-example-page") end - scenario "Valid custom page", :js do + scenario "Valid custom page" do visit admin_root_path within("#side_menu") do @@ -81,7 +81,7 @@ describe "Admin custom pages", :admin do expect(page).to have_content "another-custom-example-page" end - scenario "Allows images in CKEditor", :js do + scenario "Allows images in CKEditor" do visit edit_admin_site_customization_page_path(custom_page) fill_in_ckeditor "Content", with: "Will add an image" diff --git a/spec/system/admin/stats_spec.rb b/spec/system/admin/stats_spec.rb index 3dd41a42e..2c90ffbc6 100644 --- a/spec/system/admin/stats_spec.rb +++ b/spec/system/admin/stats_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Stats", :admin do - context "Summary", :js do + context "Summary" do scenario "General" do create(:debate) 2.times { create(:proposal) } @@ -30,7 +30,7 @@ describe "Stats", :admin do end end - context "Users", :js do + context "Users" do scenario "Summary" do 1.times { create(:user, :level_three) } 2.times { create(:user, :level_two) } @@ -86,13 +86,13 @@ describe "Stats", :admin do end end - describe "Budget investments", :js do + describe "Budget investments" do context "Supporting phase" do let(:budget) { create(:budget) } let(:group_all_city) { create(:budget_group, budget: budget) } let!(:heading_all_city) { create(:budget_heading, group: group_all_city) } - scenario "Number of supports in investment projects", :js do + scenario "Number of supports in investment projects" do group_2 = create(:budget_group, budget: budget) create(:budget_investment, heading: create(:budget_heading, group: group_2), voters: [create(:user)]) @@ -216,7 +216,7 @@ describe "Stats", :admin do end context "graphs" do - scenario "event graphs", :js do + scenario "event graphs" do campaign = create(:campaign) visit root_path(track_id: campaign.track_id) @@ -393,7 +393,7 @@ describe "Stats", :admin do end end - context "SDG", :js do + context "SDG" do scenario "Shows SDG stats link when SDG feature is enabled" do Setting["feature.sdg"] = true diff --git a/spec/system/admin/system_emails_spec.rb b/spec/system/admin/system_emails_spec.rb index 37c56e386..ea688440d 100644 --- a/spec/system/admin/system_emails_spec.rb +++ b/spec/system/admin/system_emails_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -describe "System Emails", :js do +describe "System Emails" do let(:admin) { create(:administrator) } before do diff --git a/spec/system/admin/tags_spec.rb b/spec/system/admin/tags_spec.rb index 6c4b3bea1..fd5acee45 100644 --- a/spec/system/admin/tags_spec.rb +++ b/spec/system/admin/tags_spec.rb @@ -29,7 +29,7 @@ describe "Admin tags", :admin do expect(page).to have_content "important issues" end - scenario "Delete", :js do + scenario "Delete" do tag2 = create(:tag, :category, name: "bad tag") create(:debate, tag_list: "bad tag") @@ -46,7 +46,7 @@ describe "Admin tags", :admin do expect(page).to have_content "Existence" end - scenario "Delete tag with hidden taggables", :js do + scenario "Delete tag with hidden taggables" do tag2 = create(:tag, :category, name: "bad tag") debate = create(:debate, tag_list: "bad tag") debate.hide diff --git a/spec/system/admin/translatable_spec.rb b/spec/system/admin/translatable_spec.rb index b39ac2646..9253b504b 100644 --- a/spec/system/admin/translatable_spec.rb +++ b/spec/system/admin/translatable_spec.rb @@ -13,7 +13,7 @@ describe "Admin edit translatable records", :admin do end.to_h end - context "Add a translation", :js do + context "Add a translation" do context "Input fields" do let(:translatable) { create(:budget_heading) } let(:path) { admin_polymorphic_path(translatable, action: :edit) } @@ -99,7 +99,7 @@ describe "Admin edit translatable records", :admin do end end - context "Locale with non-underscored name", :js do + context "Locale with non-underscored name" do let(:translatable) { create(:legislation_question) } let(:path) { edit_admin_legislation_process_question_path(translatable.process, translatable) } @@ -118,7 +118,7 @@ describe "Admin edit translatable records", :admin do end end - context "Add an invalid translation", :js do + context "Add an invalid translation" do let(:translatable) { create(:budget_investment) } context "Input field" do @@ -181,7 +181,7 @@ describe "Admin edit translatable records", :admin do end end - context "Update a translation", :js do + context "Update a translation" do context "Input fields" do let(:translatable) { create(:widget_card) } let(:path) { edit_admin_widget_card_path(translatable) } @@ -240,7 +240,7 @@ describe "Admin edit translatable records", :admin do end end - context "Change value of a translated field to blank", :js do + context "Change value of a translated field to blank" do let(:translatable) { create(:poll) } let(:path) { edit_admin_poll_path(translatable) } @@ -259,7 +259,7 @@ describe "Admin edit translatable records", :admin do end end - context "Update a translation with invalid data", :js do + context "Update a translation with invalid data" do context "Input fields" do let(:translatable) { create(:banner) } @@ -305,7 +305,7 @@ describe "Admin edit translatable records", :admin do end end - context "Update a translation not having the current locale", :js do + context "Update a translation not having the current locale" do let(:translatable) { create(:legislation_process) } before do @@ -330,7 +330,7 @@ describe "Admin edit translatable records", :admin do end end - context "Remove a translation", :js do + context "Remove a translation" do let(:translatable) { create(:budget_group) } let(:path) { edit_admin_budget_group_path(translatable.budget, translatable) } @@ -351,7 +351,7 @@ describe "Admin edit translatable records", :admin do end end - context "Remove all translations", :js do + context "Remove all translations" do let(:translatable) { create(:milestone) } scenario "Shows an error message" do @@ -366,7 +366,7 @@ describe "Admin edit translatable records", :admin do end end - context "Remove a translation with invalid data", :js do + context "Remove a translation with invalid data" do let(:translatable) { create(:poll_question) } let(:path) { edit_admin_question_path(translatable) } @@ -392,7 +392,7 @@ describe "Admin edit translatable records", :admin do end end - context "Current locale translation does not exist", :js do + context "Current locale translation does not exist" do context "For all translatable except ActivePoll and Budget::Phase" do let(:translatable) { create(:admin_notification, segment_recipient: "all_users") } @@ -455,7 +455,7 @@ describe "Admin edit translatable records", :admin do end end - context "Globalize javascript interface", :js do + context "Globalize javascript interface" do let(:translatable) { create(:i18n_content) } let(:content) { translatable } let(:path) { admin_site_customization_information_texts_path } diff --git a/spec/system/admin/users_spec.rb b/spec/system/admin/users_spec.rb index 8fc1d50f7..5024a98d9 100644 --- a/spec/system/admin/users_spec.rb +++ b/spec/system/admin/users_spec.rb @@ -16,7 +16,7 @@ describe "Admin users" do expect(page).to have_content admin.email end - scenario "The username links to their public profile", :js do + scenario "The username links to their public profile" do within_window(window_opened_by { click_link user.name }) do expect(page).to have_current_path(user_path(user)) end diff --git a/spec/system/admin/valuator_groups_spec.rb b/spec/system/admin/valuator_groups_spec.rb index ab5ac5f25..ec49c9bd1 100644 --- a/spec/system/admin/valuator_groups_spec.rb +++ b/spec/system/admin/valuator_groups_spec.rb @@ -63,7 +63,7 @@ describe "Valuator groups", :admin do expect(page).to have_content "Health and Sports" end - scenario "Delete", :js do + scenario "Delete" do create(:valuator_group) visit admin_valuator_groups_path diff --git a/spec/system/admin/valuators_spec.rb b/spec/system/admin/valuators_spec.rb index 38d4a3009..023db8a2f 100644 --- a/spec/system/admin/valuators_spec.rb +++ b/spec/system/admin/valuators_spec.rb @@ -21,7 +21,7 @@ describe "Admin valuators", :admin do expect(page).not_to have_content(user.name) end - scenario "Create", :js do + scenario "Create" do fill_in "search", with: user.email click_button "Search" @@ -50,7 +50,7 @@ describe "Admin valuators", :admin do expect(page).not_to have_content "Can edit dossier" end - scenario "Destroy", :js do + scenario "Destroy" do accept_confirm { click_link "Delete" } within("#valuators") do diff --git a/spec/system/admin/widgets/cards_spec.rb b/spec/system/admin/widgets/cards_spec.rb index a34648248..1acba7873 100644 --- a/spec/system/admin/widgets/cards_spec.rb +++ b/spec/system/admin/widgets/cards_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "Cards", :admin do - scenario "Create", :js do + scenario "Create" do visit admin_homepage_path click_link "Create card" @@ -29,7 +29,7 @@ describe "Cards", :admin do end end - scenario "Create with errors", :js do + scenario "Create with errors" do visit admin_homepage_path click_link "Create card" click_button "Create card" @@ -100,7 +100,7 @@ describe "Cards", :admin do end end - scenario "Remove", :js do + scenario "Remove" do card = create(:widget_card) visit admin_homepage_path @@ -143,7 +143,7 @@ describe "Cards", :admin do end end - scenario "Create with errors", :js do + scenario "Create with errors" do visit admin_homepage_path click_link "Create header" click_button "Create header" @@ -155,7 +155,7 @@ describe "Cards", :admin do context "Page card" do let!(:custom_page) { create(:site_customization_page, :published) } - scenario "Create", :js do + scenario "Create" do visit admin_site_customization_pages_path within "#site_customization_page_#{custom_page.id}" do @@ -188,7 +188,7 @@ describe "Cards", :admin do expect(page).to have_css("#widget_card_#{card_3.id}.medium-2") end - scenario "Show label only if it is present", :js do + scenario "Show label only if it is present" do card_1 = create(:widget_card, cardable: custom_page, title: "Card one", label: "My label") card_2 = create(:widget_card, cardable: custom_page, title: "Card two") @@ -203,7 +203,7 @@ describe "Cards", :admin do end end - scenario "Edit", :js do + scenario "Edit" do create(:widget_card, cardable: custom_page, title: "Original title") visit admin_site_customization_page_widget_cards_path(custom_page) @@ -226,7 +226,7 @@ describe "Cards", :admin do expect(page).not_to have_content "Original title" end - scenario "Destroy", :js do + scenario "Destroy" do create(:widget_card, cardable: custom_page, title: "Card title") visit admin_site_customization_page_widget_cards_path(custom_page) diff --git a/spec/system/admin_spec.rb b/spec/system/admin_spec.rb index 53151f101..3f115c7dc 100644 --- a/spec/system/admin_spec.rb +++ b/spec/system/admin_spec.rb @@ -42,7 +42,7 @@ describe "Admin" do expect(page).to have_content "You do not have permission to access this page" end - scenario "Access as SDG manager is not authorized", :js do + scenario "Access as SDG manager is not authorized" do create(:sdg_manager, user: user) login_as(user) visit admin_root_path @@ -68,7 +68,7 @@ describe "Admin" do expect(page).not_to have_content "You do not have permission to access this page" end - scenario "Admin access links", :admin, :js do + scenario "Admin access links", :admin do Setting["feature.sdg"] = true visit root_path @@ -81,7 +81,7 @@ describe "Admin" do expect(page).to have_link("SDG content") end - scenario "Admin dashboard", :admin, :js do + scenario "Admin dashboard", :admin do visit root_path click_link "Menu" @@ -93,7 +93,7 @@ describe "Admin" do expect(page).not_to have_css("#valuation_menu") end - scenario "Admin menu does not hide active elements", :js, :admin do + scenario "Admin menu does not hide active elements", :admin do visit admin_budgets_path within("#admin_menu") do diff --git a/spec/system/advanced_search_spec.rb b/spec/system/advanced_search_spec.rb index f05545839..27d281c10 100644 --- a/spec/system/advanced_search_spec.rb +++ b/spec/system/advanced_search_spec.rb @@ -1,6 +1,6 @@ require "rails_helper" -describe "Advanced search", :js do +describe "Advanced search" do let(:budget) { create(:budget, name: "Big Budget") } let(:heading) { create(:budget_heading, budget: budget, name: "More hospitals") } diff --git a/spec/system/budget_polls/ballot_sheets_spec.rb b/spec/system/budget_polls/ballot_sheets_spec.rb index 0831bf614..eb2874f63 100644 --- a/spec/system/budget_polls/ballot_sheets_spec.rb +++ b/spec/system/budget_polls/ballot_sheets_spec.rb @@ -15,7 +15,7 @@ describe "Poll budget ballot sheets" do set_officing_booth(booth) end - scenario "Budget polls are visible", :js do + scenario "Budget polls are visible" do visit root_path click_link "Menu" @@ -125,7 +125,7 @@ describe "Poll budget ballot sheets" do expect(page).to have_content("CSV data can't be blank") end - scenario "Shift booth has to be selected", :js do + scenario "Shift booth has to be selected" do visit new_officing_poll_ballot_sheet_path(poll) fill_in "data", with: "1234;5678" @@ -144,7 +144,7 @@ describe "Poll budget ballot sheets" do set_officing_booth(booth) end - scenario "Ballot sheet information is displayed", :js do + scenario "Ballot sheet information is displayed" do officer_assignment = create(:poll_officer_assignment, officer: poll_officer) ballot_sheet = create(:poll_ballot_sheet, poll: poll, officer_assignment: officer_assignment) diff --git a/spec/system/budget_polls/budgets_spec.rb b/spec/system/budget_polls/budgets_spec.rb index d921c047a..548488776 100644 --- a/spec/system/budget_polls/budgets_spec.rb +++ b/spec/system/budget_polls/budgets_spec.rb @@ -20,7 +20,7 @@ describe "Admin Budgets", :admin do expect(Poll.last.budget).to eq(budget) end - scenario "Create poll in current locale if the budget does not have a poll associated", :js do + scenario "Create poll in current locale if the budget does not have a poll associated" do budget = create(:budget, name_en: "Budget for climate change", name_fr: "Budget pour le changement climatique") diff --git a/spec/system/budget_polls/voter_spec.rb b/spec/system/budget_polls/voter_spec.rb index 53f31c60d..95034b4fd 100644 --- a/spec/system/budget_polls/voter_spec.rb +++ b/spec/system/budget_polls/voter_spec.rb @@ -15,7 +15,7 @@ describe "BudgetPolls", :with_frozen_time do end context "Offline" do - scenario "A citizen can cast a paper vote", :js do + scenario "A citizen can cast a paper vote" do login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -46,7 +46,7 @@ describe "BudgetPolls", :with_frozen_time do end end - scenario "A citizen cannot vote offline again", :js do + scenario "A citizen cannot vote offline again" do login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -66,7 +66,7 @@ describe "BudgetPolls", :with_frozen_time do end end - scenario "A citizen cannot vote online after voting offline", :js do + scenario "A citizen cannot vote online after voting offline" do login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -91,7 +91,7 @@ describe "BudgetPolls", :with_frozen_time do end context "Online" do - scenario "A citizen can cast vote online", :js do + scenario "A citizen can cast vote online" do login_as(user) visit budget_investment_path(budget, investment) @@ -101,7 +101,7 @@ describe "BudgetPolls", :with_frozen_time do end end - scenario "A citizen cannot vote online again", :js do + scenario "A citizen cannot vote online again" do login_as(user) visit budget_investment_path(budget, investment) @@ -118,7 +118,7 @@ describe "BudgetPolls", :with_frozen_time do end end - scenario "A citizen cannot vote offline after voting online", :js do + scenario "A citizen cannot vote offline after voting online" do login_as(user) visit budget_investment_path(budget, investment) diff --git a/spec/system/budgets/ballots_spec.rb b/spec/system/budgets/ballots_spec.rb index b959497a3..3306425e5 100644 --- a/spec/system/budgets/ballots_spec.rb +++ b/spec/system/budgets/ballots_spec.rb @@ -32,7 +32,7 @@ describe "Ballots" do login_as(user) end - scenario "finds ballot lines using budget slug", :js do + scenario "finds ballot lines using budget slug" do visit budget_investments_path("budget_slug", states, california) add_to_ballot("More rain") @@ -106,7 +106,7 @@ describe "Ballots" do end context "Adding and Removing Investments" do - scenario "Add a investment", :js do + scenario "Add a investment" do create(:budget_investment, :selected, heading: new_york, price: 10000, title: "Bring back King Kong") create(:budget_investment, :selected, heading: new_york, price: 20000, title: "Paint cabs black") @@ -134,7 +134,7 @@ describe "Ballots" do end end - scenario "Removing a investment", :js do + scenario "Removing a investment" do investment = create(:budget_investment, :selected, heading: new_york, price: 10000, balloters: [user]) visit budget_investments_path(budget, heading_id: new_york) @@ -163,7 +163,7 @@ describe "Ballots" do end end - scenario "the Map shoud be visible before and after", :js do + scenario "the Map shoud be visible before and after" do create(:budget_investment, :selected, heading: new_york, price: 10000, title: "More bridges") visit budget_investments_path(budget, heading_id: new_york) @@ -192,7 +192,7 @@ describe "Ballots" do #Break up or simplify with helpers context "Balloting in multiple headings" do - scenario "Independent progress bar for headings", :js do + scenario "Independent progress bar for headings" do city_heading = create(:budget_heading, group: city, name: "All city", price: 10000000) district_heading1 = create(:budget_heading, group: districts, name: "District 1", price: 1000000) district_heading2 = create(:budget_heading, group: districts, name: "District 2", price: 2000000) @@ -250,7 +250,7 @@ describe "Ballots" do end end - scenario "Display progress bar after first vote", :js do + scenario "Display progress bar after first vote" do create(:budget_investment, :selected, heading: new_york, price: 10000, title: "Park expansion") visit budget_investments_path(budget, heading_id: new_york.id) @@ -266,7 +266,7 @@ describe "Ballots" do context "Groups" do before { login_as(user) } - scenario "Select my heading", :js do + scenario "Select my heading" do create(:budget_investment, :selected, heading: california, title: "Green beach") visit budget_investments_path(budget, heading_id: california) @@ -279,7 +279,7 @@ describe "Ballots" do expect(page).to have_css("#budget_heading_#{california.id}.is-active") end - scenario "Change my heading", :js do + scenario "Change my heading" do create(:budget_investment, :selected, heading: california, title: "Early ShakeAlert", balloters: [user]) create(:budget_investment, :selected, heading: new_york, title: "Avengers Tower") @@ -311,7 +311,7 @@ describe "Ballots" do end end - context "Showing the ballot", :js do + context "Showing the ballot" do scenario "Displaying the correct group, heading, count & amount" do group1 = create(:budget_group, budget: budget) group2 = create(:budget_group, budget: budget) @@ -358,7 +358,7 @@ describe "Ballots" do end end - scenario "Removing investments from ballot", :js do + scenario "Removing investments from ballot" do investment = create(:budget_investment, :selected, price: 10, heading: new_york) user = create(:user, :level_two, ballot_lines: [investment]) @@ -375,7 +375,7 @@ describe "Ballots" do expect(page).to have_content("You have voted 0 investments") end - scenario "Removing investments from ballot (sidebar)", :js do + scenario "Removing investments from ballot (sidebar)" do investment1 = create(:budget_investment, :selected, price: 10000, heading: new_york) investment2 = create(:budget_investment, :selected, price: 20000, heading: new_york) user = create(:user, :level_two, ballot_lines: [investment1, investment2]) @@ -410,7 +410,7 @@ describe "Ballots" do end end - describe "Back link", :js do + describe "Back link" do scenario "after adding and removing an investment from the ballot" do create(:budget_investment, :selected, heading: new_york, price: 10, title: "Sully monument") @@ -452,7 +452,7 @@ describe "Ballots" do end context "Permissions" do - scenario "User not logged in", :js do + scenario "User not logged in" do investment = create(:budget_investment, :selected, heading: new_york) visit budget_investments_path(budget, heading_id: new_york.id) @@ -465,7 +465,7 @@ describe "Ballots" do end end - scenario "User not verified", :js do + scenario "User not verified" do unverified_user = create(:user) investment = create(:budget_investment, :selected, heading: new_york) @@ -480,7 +480,7 @@ describe "Ballots" do end end - scenario "User is organization", :js do + scenario "User is organization" do org = create(:organization) investment = create(:budget_investment, :selected, heading: new_york) @@ -515,7 +515,7 @@ describe "Ballots" do end end - scenario "Different district", :js do + scenario "Different district" do bi1 = create(:budget_investment, :selected, heading: california) bi2 = create(:budget_investment, :selected, heading: new_york) user = create(:user, :level_two, ballot_lines: [bi1]) @@ -531,7 +531,7 @@ describe "Ballots" do end end - scenario "Insufficient funds (on page load)", :js do + scenario "Insufficient funds (on page load)" do bi1 = create(:budget_investment, :selected, heading: california, price: 600) bi2 = create(:budget_investment, :selected, heading: california, price: 500) user = create(:user, :level_two, ballot_lines: [bi1]) @@ -547,7 +547,7 @@ describe "Ballots" do end end - scenario "Insufficient funds (added after create)", :js do + scenario "Insufficient funds (added after create)" do create(:budget_investment, :selected, heading: california, price: 600, title: "Build replicants") create(:budget_investment, :selected, heading: california, price: 500, title: "Build terminators") @@ -571,7 +571,7 @@ describe "Ballots" do end end - scenario "Insufficient funds (removed after destroy)", :js do + scenario "Insufficient funds (removed after destroy)" do bi1 = create(:budget_investment, :selected, heading: california, price: 600) bi2 = create(:budget_investment, :selected, heading: california, price: 500) user = create(:user, :level_two, ballot_lines: [bi1]) @@ -599,7 +599,7 @@ describe "Ballots" do end end - scenario "Insufficient funds (removed after destroying from sidebar)", :js do + scenario "Insufficient funds (removed after destroying from sidebar)" do bi1 = create(:budget_investment, :selected, heading: california, price: 600) bi2 = create(:budget_investment, :selected, heading: california, price: 500) user = create(:user, :level_two, ballot_lines: [bi1]) @@ -628,7 +628,7 @@ describe "Ballots" do end end - scenario "Edge case voting a non-elegible investment", :js do + scenario "Edge case voting a non-elegible investment" do investment1 = create(:budget_investment, :selected, heading: new_york, price: 10000) in_browser(:user) do @@ -662,7 +662,7 @@ describe "Ballots" do end end - scenario "Balloting is disabled when budget isn't in the balotting phase", :js do + scenario "Balloting is disabled when budget isn't in the balotting phase" do budget.update!(phase: "accepting") bi1 = create(:budget_investment, :selected, heading: california, price: 600) diff --git a/spec/system/budgets/budgets_spec.rb b/spec/system/budgets/budgets_spec.rb index de8b4b4d6..9b98200d3 100644 --- a/spec/system/budgets/budgets_spec.rb +++ b/spec/system/budgets/budgets_spec.rb @@ -16,7 +16,7 @@ describe "Budgets" do end context "Index" do - scenario "Show normal index with links", :js do + scenario "Show normal index with links" do group1 = create(:budget_group, budget: budget) group2 = create(:budget_group, budget: budget) heading1 = create(:budget_heading, group: group1) @@ -99,7 +99,7 @@ describe "Budgets" do end end - scenario "Show informing index without links", :js do + scenario "Show informing index without links" do budget.update!(phase: "informing") heading = create(:budget_heading, budget: budget) @@ -117,7 +117,7 @@ describe "Budgets" do end end - scenario "Show finished index without heading links", :js do + scenario "Show finished index without heading links" do budget.update!(phase: "finished") heading = create(:budget_heading, budget: budget) @@ -149,7 +149,7 @@ describe "Budgets" do end end - scenario "Index shows only published phases", :js do + scenario "Index shows only published phases" do budget.update!(phase: :finished) phases = budget.phases @@ -230,7 +230,7 @@ describe "Budgets" do Setting["feature.map"] = true end - scenario "Display investment's map location markers", :js do + scenario "Display investment's map location markers" do investment1 = create(:budget_investment, heading: heading) investment2 = create(:budget_investment, heading: heading) investment3 = create(:budget_investment, heading: heading) @@ -246,7 +246,7 @@ describe "Budgets" do end end - scenario "Display all investment's map location if there are no selected", :js do + scenario "Display all investment's map location if there are no selected" do budget.update!(phase: :publishing_prices) investment1 = create(:budget_investment, heading: heading) @@ -266,7 +266,7 @@ describe "Budgets" do end end - scenario "Display only selected investment's map location from publishing prices phase", :js do + scenario "Display only selected investment's map location from publishing prices phase" do budget.update!(phase: :publishing_prices) investment1 = create(:budget_investment, :selected, heading: heading) @@ -286,7 +286,7 @@ describe "Budgets" do end end - scenario "Skip invalid map markers", :js do + scenario "Skip invalid map markers" do map_locations = [] investment = create(:budget_investment, heading: heading) diff --git a/spec/system/budgets/executions_spec.rb b/spec/system/budgets/executions_spec.rb index 3474c40f4..723b817c2 100644 --- a/spec/system/budgets/executions_spec.rb +++ b/spec/system/budgets/executions_spec.rb @@ -60,7 +60,7 @@ describe "Executions" do expect(page).not_to have_content(empty_heading.name) end - scenario "Show message when there are no winning investments with the selected status", :js do + scenario "Show message when there are no winning investments with the selected status" do create(:milestone_status, name: I18n.t("seeds.budgets.statuses.executed")) visit budget_path(budget) @@ -152,7 +152,7 @@ describe "Executions" do expect(page).to have_content("#{status2.name} (1)") end - scenario "by milestone status", :js do + scenario "by milestone status" do create(:milestone, milestoneable: investment1, status: status1) create(:milestone, milestoneable: investment2, status: status2) create(:milestone_status, name: I18n.t("seeds.budgets.statuses.executing_project")) @@ -181,7 +181,7 @@ describe "Executions" do expect(page).not_to have_content(investment2.title) end - scenario "are based on latest milestone status", :js do + scenario "are based on latest milestone status" do create(:milestone, milestoneable: investment1, publication_date: 1.month.ago, status: status1) @@ -201,7 +201,7 @@ describe "Executions" do expect(page).to have_content(investment1.title) end - scenario "milestones with future dates are not shown", :js do + scenario "milestones with future dates are not shown" do create(:milestone, milestoneable: investment1, publication_date: Date.yesterday, status: status1) @@ -221,7 +221,7 @@ describe "Executions" do expect(page).not_to have_content(investment1.title) end - scenario "by milestone tag, only display tags for winner investments", :js do + scenario "by milestone tag, only display tags for winner investments" do create(:milestone, milestoneable: investment1, status: status1) create(:milestone, milestoneable: investment2, status: status2) create(:milestone, milestoneable: investment3, status: status2) diff --git a/spec/system/budgets/groups_spec.rb b/spec/system/budgets/groups_spec.rb index bd426930c..d70b87bcc 100644 --- a/spec/system/budgets/groups_spec.rb +++ b/spec/system/budgets/groups_spec.rb @@ -26,7 +26,7 @@ describe "Budget Groups" do expect(first_heading.name).to appear_before(last_heading.name) end - scenario "Links to investment filters", :js do + scenario "Links to investment filters" do create(:budget_heading, group: group, name: "Southwest") budget.update!(phase: "finished") @@ -45,7 +45,7 @@ describe "Budget Groups" do expect(page).not_to have_link "See investments not selected for balloting phase unfeasible investments" end - scenario "Back link", :js do + scenario "Back link" do visit budget_group_path(budget, group) click_link "Go back" diff --git a/spec/system/budgets/investments_spec.rb b/spec/system/budgets/investments_spec.rb index 067246404..8d34dc287 100644 --- a/spec/system/budgets/investments_spec.rb +++ b/spec/system/budgets/investments_spec.rb @@ -112,7 +112,7 @@ describe "Budget Investments" do end end - scenario "Index should show a map if heading has coordinates defined", :js do + scenario "Index should show a map if heading has coordinates defined" do create(:budget_investment, heading: heading) visit budget_investments_path(budget, heading_id: heading.id) within("#sidebar") do @@ -128,7 +128,7 @@ describe "Budget Investments" do end end - scenario "Index filter by status", :js do + scenario "Index filter by status" do budget.update!(phase: "finished") create(:budget_investment, :feasible, heading: heading, title: "Feasible investment") @@ -240,7 +240,7 @@ describe "Budget Investments" do end end - scenario "unfeasible", :js do + scenario "unfeasible" do investment1 = create(:budget_investment, :unfeasible, :finished, heading: heading) investment2 = create(:budget_investment, :feasible, heading: heading) @@ -305,7 +305,7 @@ describe "Budget Investments" do expect(order).to eq(new_order) end - scenario "Random order maintained with pagination", :js do + scenario "Random order maintained with pagination" do (per_page + 2).times { create(:budget_investment, heading: heading) } visit budget_investments_path(budget, heading_id: heading.id) @@ -338,7 +338,7 @@ describe "Budget Investments" do expect(order).to eq(new_order) end - scenario "Investments are not repeated with random order", :js do + scenario "Investments are not repeated with random order" do (per_page + 2).times { create(:budget_investment, heading: heading) } visit budget_investments_path(budget, order: "random") @@ -376,7 +376,7 @@ describe "Budget Investments" do expect(page).to have_current_path(/page=1/) end - scenario "Each user has a different and consistent random budget investment order", :js do + scenario "Each user has a different and consistent random budget investment order" do (per_page * 1.3).to_i.times { create(:budget_investment, heading: heading) } first_user_investments_order = nil second_user_investments_order = nil @@ -518,7 +518,7 @@ describe "Budget Investments" do expect(page).to have_current_path(budget_investments_path(budget)) end - scenario "Create budget investment too fast", :js do + scenario "Create budget investment too fast" do allow(InvisibleCaptcha).to receive(:timestamp_threshold).and_return(Float::INFINITY) login_as(author) @@ -535,7 +535,7 @@ describe "Budget Investments" do expect(page).to have_current_path(new_budget_investment_path(budget)) end - scenario "Create", :js do + scenario "Create" do login_as(author) visit new_budget_investment_path(budget) @@ -562,7 +562,7 @@ describe "Budget Investments" do expect(page).to have_content "Build a skyscraper" end - scenario "Edit", :js do + scenario "Edit" do daniel = create(:user, :level_two) create(:budget_investment, heading: heading, title: "Get Schwifty", author: daniel, created_at: 1.day.ago) @@ -619,7 +619,7 @@ describe "Budget Investments" do context "Suggest" do factory = :budget_investment - scenario "Show up to 5 suggestions", :js do + scenario "Show up to 5 suggestions" do %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end @@ -634,7 +634,7 @@ describe "Budget Investments" do end end - scenario "No found suggestions", :js do + scenario "No found suggestions" do %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end @@ -648,7 +648,7 @@ describe "Budget Investments" do end end - scenario "Don't show suggestions from a different budget", :js do + scenario "Don't show suggestions from a different budget" do %w[first second third fourth fifth sixth].each do |ordinal| create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget) end @@ -919,7 +919,7 @@ describe "Budget Investments" do expect(page).to have_content("This investment project has not been selected for balloting phase") end - scenario "Show title (no message)", :js do + scenario "Show title (no message)" do investment = create(:budget_investment, :feasible, :finished, @@ -997,7 +997,7 @@ describe "Budget Investments" do end end - scenario "Author can destroy while on the accepting phase", :js do + scenario "Author can destroy while on the accepting phase" do user = create(:user, :level_two) investment1 = create(:budget_investment, heading: heading, price: 10000, author: user) @@ -1020,7 +1020,7 @@ describe "Budget Investments" do end context "Popup alert to vote only in one heading per group" do - scenario "When supporting in the first heading group", :js do + scenario "When supporting in the first heading group" do carabanchel = create(:budget_heading, group: group) salamanca = create(:budget_heading, group: group) @@ -1035,7 +1035,7 @@ describe "Budget Investments" do end end - scenario "When already supported in the group", :js do + scenario "When already supported in the group" do carabanchel = create(:budget_heading, group: group) salamanca = create(:budget_heading, group: group) @@ -1050,7 +1050,7 @@ describe "Budget Investments" do end end - scenario "When supporting in another group", :js do + scenario "When supporting in another group" do heading = create(:budget_heading, group: group) group2 = create(:budget_group, budget: budget) @@ -1068,7 +1068,7 @@ describe "Budget Investments" do end end - scenario "When supporting in a group with a single heading", :js do + scenario "When supporting in a group with a single heading" do all_city_investment = create(:budget_investment, heading: heading) login_as(author) @@ -1080,7 +1080,7 @@ describe "Budget Investments" do end end - scenario "Sidebar in show should display support text", :js do + scenario "Sidebar in show should display support text" do investment = create(:budget_investment, budget: budget) visit budget_investment_path(budget, investment) @@ -1095,7 +1095,7 @@ describe "Budget Investments" do budget.update(phase: "valuating") end - scenario "Sidebar in show should display support text and count", :js do + scenario "Sidebar in show should display support text and count" do investment = create(:budget_investment, :selected, budget: budget, voters: [create(:user)]) visit budget_investment_path(budget, investment) @@ -1116,7 +1116,7 @@ describe "Budget Investments" do end end - scenario "Show should display support text and count", :js do + scenario "Show should display support text and count" do investment = create(:budget_investment, budget: budget, heading: heading, voters: [create(:user)]) visit budget_investment_path(budget, investment) @@ -1209,7 +1209,7 @@ describe "Budget Investments" do expect(page).to have_content "€10,000" end - scenario "Sidebar in show should display vote text", :js do + scenario "Sidebar in show should display vote text" do investment = create(:budget_investment, :selected, budget: budget) visit budget_investment_path(budget, investment) @@ -1218,7 +1218,7 @@ describe "Budget Investments" do end end - scenario "Confirm", :js do + scenario "Confirm" do budget.update!(phase: "balloting") user = create(:user, :level_two) @@ -1276,7 +1276,7 @@ describe "Budget Investments" do end end - scenario "Highlight voted heading except with unfeasible filter", :js do + scenario "Highlight voted heading except with unfeasible filter" do budget.update!(phase: "balloting") user = create(:user, :level_two) @@ -1304,7 +1304,7 @@ describe "Budget Investments" do end end - scenario "Ballot is visible", :js do + scenario "Ballot is visible" do login_as(author) visit budget_investments_path(budget, heading_id: heading.id) @@ -1394,7 +1394,7 @@ describe "Budget Investments" do end context "sidebar map" do - scenario "Display 6 investment's markers on sidebar map", :js do + scenario "Display 6 investment's markers on sidebar map" do investment1 = create(:budget_investment, heading: heading) investment2 = create(:budget_investment, heading: heading) investment3 = create(:budget_investment, heading: heading) @@ -1416,7 +1416,7 @@ describe "Budget Investments" do end end - scenario "Display 2 investment's markers on sidebar map", :js do + scenario "Display 2 investment's markers on sidebar map" do investment1 = create(:budget_investment, heading: heading) investment2 = create(:budget_investment, heading: heading) @@ -1430,7 +1430,7 @@ describe "Budget Investments" do end end - scenario "Display only investment's related to the current heading", :js do + scenario "Display only investment's related to the current heading" do heading_2 = create(:budget_heading, name: "Madrid", group: group) investment1 = create(:budget_investment, heading: heading) @@ -1454,7 +1454,7 @@ describe "Budget Investments" do end end - scenario "Do not display investment's, since they're all related to other heading", :js do + scenario "Do not display investment's, since they're all related to other heading" do heading_2 = create(:budget_heading, name: "Madrid", group: group) investment1 = create(:budget_investment, heading: heading_2) @@ -1472,7 +1472,7 @@ describe "Budget Investments" do end end - scenario "Shows all investments and not only the ones on the current page", :js do + scenario "Shows all investments and not only the ones on the current page" do stub_const("#{Budgets::InvestmentsController}::PER_PAGE", 2) 3.times do @@ -1505,7 +1505,7 @@ describe "Budget Investments" do end end - scenario "Contains edit button in the accepting phase", :js do + scenario "Contains edit button in the accepting phase" do investment = create(:budget_investment, heading: heading, author: author) login_as(author) @@ -1518,7 +1518,7 @@ describe "Budget Investments" do end end - scenario "Contains remove image button in phases different from accepting", :js do + scenario "Contains remove image button in phases different from accepting" do budget.update!(phase: "reviewing") investment = create(:budget_investment, :with_image, heading: heading, author: author) @@ -1541,7 +1541,7 @@ describe "Budget Investments" do budget.update!(phase: "accepting") end - scenario "create budget investment with sdg related list", :js do + scenario "create budget investment with sdg related list" do login_as(author) visit new_budget_investment_path(budget) select heading.name, from: "Heading" @@ -1555,7 +1555,7 @@ describe "Budget Investments" do within(".sdg-goal-tag-list") { expect(page).to have_link "1. No Poverty" } end - scenario "edit budget investment with sdg related list", :js do + scenario "edit budget investment with sdg related list" do investment = create(:budget_investment, heading: heading, author: author) investment.sdg_goals = [SDG::Goal[1], SDG::Goal[2]] login_as(author) diff --git a/spec/system/budgets/results_spec.rb b/spec/system/budgets/results_spec.rb index e7e00795d..50d5c54b9 100644 --- a/spec/system/budgets/results_spec.rb +++ b/spec/system/budgets/results_spec.rb @@ -48,7 +48,7 @@ describe "Results" do end end - scenario "Show non winner & incomaptible investments", :js do + scenario "Show non winner & incomaptible investments" do visit budget_path(budget) click_link "See results" click_link "Show all" @@ -112,7 +112,7 @@ describe "Results" do expect(page).to have_content "You do not have permission to carry out the action" end - scenario "No incompatible investments", :js do + scenario "No incompatible investments" do investment3.incompatible = false investment3.save! diff --git a/spec/system/budgets/votes_spec.rb b/spec/system/budgets/votes_spec.rb index 946536931..f47d4dfed 100644 --- a/spec/system/budgets/votes_spec.rb +++ b/spec/system/budgets/votes_spec.rb @@ -36,7 +36,7 @@ describe "Votes" do end end - scenario "Create from investments' index", :js do + scenario "Create from investments' index" do create(:budget_investment, heading: heading) visit budget_investments_path(budget, heading_id: heading.id) @@ -59,7 +59,7 @@ describe "Votes" do expect(page).to have_content "No supports" end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit budget_investment_path(budget, investment) within(".supports") do @@ -70,7 +70,7 @@ describe "Votes" do end end - scenario "Create from investment show", :js do + scenario "Create from investment show" do visit budget_investment_path(budget, investment) within(".supports") do @@ -83,7 +83,7 @@ describe "Votes" do end end - scenario "Disable voting on investments", :js do + scenario "Disable voting on investments" do budget.update!(phase: "reviewing") investment = create(:budget_investment, heading: heading) @@ -116,7 +116,7 @@ describe "Votes" do group.update(max_votable_headings: 2) end - scenario "From Index", :js do + scenario "From Index" do visit budget_investments_path(budget, heading_id: new_york.id) within("#budget_investment_#{new_york_investment.id}") do @@ -157,7 +157,7 @@ describe "Votes" do end end - scenario "From show", :js do + scenario "From show" do visit budget_investment_path(budget, new_york_investment) accept_confirm { find(".in-favor a").click } @@ -187,7 +187,7 @@ describe "Votes" do "Share it!" end - scenario "Confirm message shows the right text", :js do + scenario "Confirm message shows the right text" do visit budget_investments_path(budget, heading_id: new_york.id) find(".in-favor a").click @@ -200,7 +200,7 @@ describe "Votes" do let(:budget) { create(:budget, :balloting, :approval) } before { login_as(manuela) } - scenario "Budget limit is ignored", :js do + scenario "Budget limit is ignored" do group = create(:budget_group, budget: budget) heading = create(:budget_heading, group: group, max_ballot_lines: 2) investment1 = create(:budget_investment, :selected, heading: heading, price: heading.price) diff --git a/spec/system/ckeditor_spec.rb b/spec/system/ckeditor_spec.rb index 9000b1c7d..d13b67498 100644 --- a/spec/system/ckeditor_spec.rb +++ b/spec/system/ckeditor_spec.rb @@ -1,7 +1,7 @@ require "rails_helper" describe "CKEditor" do - scenario "is present before & after turbolinks update page", :js do + scenario "is present before & after turbolinks update page" do author = create(:user) login_as(author) @@ -15,7 +15,7 @@ describe "CKEditor" do expect(page).to have_css ".translatable-fields[data-locale='en'] .cke_wysiwyg_frame" end - scenario "uploading an image through the upload tab", :js, :admin do + scenario "uploading an image through the upload tab", :admin do visit new_admin_site_customization_page_path fill_in_ckeditor "Content", with: "Filling in to make sure CKEditor is loaded" find(".cke_button__image").click @@ -38,7 +38,7 @@ describe "CKEditor" do expect(page).to have_css "img[src$='clippy.jpg']" end - scenario "cannot upload attachments through link tab", :js, :admin do + scenario "cannot upload attachments through link tab", :admin do visit new_admin_site_customization_page_path fill_in_ckeditor "Content", with: "Filling in to make sure CKEditor is loaded" find(".cke_button__link").click @@ -49,7 +49,7 @@ describe "CKEditor" do end context "When navigating back to editor page using browser history back" do - scenario "display ckeditor unsaved contents", :js, :admin do + scenario "display ckeditor unsaved contents", :admin do visit new_admin_newsletter_path fill_in_ckeditor "Email content", with: "This is an unsaved body" click_link "Newsletters" diff --git a/spec/system/comments/budget_investments_spec.rb b/spec/system/comments/budget_investments_spec.rb index 6f077bcf8..e5539b0bf 100644 --- a/spec/system/comments/budget_investments_spec.rb +++ b/spec/system/comments/budget_investments_spec.rb @@ -58,7 +58,7 @@ describe "Commenting Budget::Investments" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, body: "Main comment", commentable: investment) child_comment = create(:comment, body: "First subcomment", commentable: investment, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: investment, parent: child_comment) @@ -197,7 +197,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit budget_investment_path(investment.budget, investment) @@ -213,7 +213,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit budget_investment_path(investment.budget, investment) @@ -222,7 +222,7 @@ describe "Commenting Budget::Investments" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") comment = create(:comment, commentable: investment, user: citizen) @@ -244,7 +244,7 @@ describe "Commenting Budget::Investments" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do comment = create(:comment, commentable: investment) login_as(create(:user)) @@ -259,7 +259,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do comment = create(:comment, commentable: investment) create(:comment, commentable: investment, parent: comment) @@ -276,7 +276,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = create(:comment, commentable: investment, user: user) login_as(user) @@ -290,7 +290,7 @@ describe "Commenting Budget::Investments" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: investment) 7.times do @@ -315,7 +315,7 @@ describe "Commenting Budget::Investments" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do moderator = create(:moderator) login_as(moderator.user) @@ -333,7 +333,7 @@ describe "Commenting Budget::Investments" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") moderator = create(:moderator, user: manuela) @@ -372,7 +372,7 @@ describe "Commenting Budget::Investments" do describe "Administrators" do context "comment as administrator" do - scenario "can create comment", :js do + scenario "can create comment" do admin = create(:administrator) login_as(admin.user) @@ -390,7 +390,7 @@ describe "Commenting Budget::Investments" do end end - scenario "display administrator description on admin views", :js do + scenario "display administrator description on admin views" do admin = create(:administrator, description: "user description") login_as(admin.user) @@ -415,7 +415,7 @@ describe "Commenting Budget::Investments" do end end - scenario "display administrator id on public views", :js do + scenario "display administrator id on public views" do admin = create(:administrator, description: "user description") login_as(admin.user) @@ -433,7 +433,7 @@ describe "Commenting Budget::Investments" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) @@ -460,7 +460,7 @@ describe "Commenting Budget::Investments" do expect(page).to have_css "div.is-admin" end - scenario "public users not see admin description", :js do + scenario "public users not see admin description" do manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) comment = create(:comment, @@ -516,7 +516,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Create", :js do + scenario "Create" do visit budget_investment_path(budget, investment) within("#comment_#{comment.id}_votes") do @@ -534,7 +534,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Update", :js do + scenario "Update" do visit budget_investment_path(budget, investment) within("#comment_#{comment.id}_votes") do @@ -558,7 +558,7 @@ describe "Commenting Budget::Investments" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit budget_investment_path(budget, investment) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/comments/budget_investments_valuation_spec.rb b/spec/system/comments/budget_investments_valuation_spec.rb index cbc2e5813..957e73188 100644 --- a/spec/system/comments/budget_investments_valuation_spec.rb +++ b/spec/system/comments/budget_investments_valuation_spec.rb @@ -58,7 +58,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, :valuation, author: valuator_user, body: "Main comment", commentable: investment) child_comment = create(:comment, :valuation, author: valuator_user, body: "First subcomment", @@ -171,7 +171,7 @@ describe "Internal valuation comments on Budget::Investments" do expect(comment.errors.size).to eq(1) end - scenario "Create comment", :js do + scenario "Create comment" do visit valuation_budget_budget_investment_path(budget, investment) fill_in "Leave your comment", with: "Have you thought about...?" @@ -185,7 +185,7 @@ describe "Internal valuation comments on Budget::Investments" do expect(page).not_to have_content("Have you thought about...?") end - scenario "Errors on create without comment text", :js do + scenario "Errors on create without comment text" do visit valuation_budget_budget_investment_path(budget, investment) click_button "Publish comment" @@ -193,7 +193,7 @@ describe "Internal valuation comments on Budget::Investments" do expect(page).to have_content "Can't be blank" end - scenario "Reply to existing valuation", :js do + scenario "Reply to existing valuation" do comment = create(:comment, :valuation, author: admin_user, commentable: investment) login_as(valuator_user) @@ -216,7 +216,7 @@ describe "Internal valuation comments on Budget::Investments" do expect(page).not_to have_content("It will be done next week.") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do comment = create(:comment, :valuation, author: admin_user, commentable: investment) login_as(valuator_user) @@ -231,7 +231,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do comment = create(:comment, :valuation, author: admin_user, commentable: investment) create(:comment, :valuation, author: admin_user, commentable: investment, parent: comment) @@ -248,7 +248,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "Errors on reply without comment text", :js do + scenario "Errors on reply without comment text" do comment = create(:comment, :valuation, author: admin_user, commentable: investment) visit valuation_budget_budget_investment_path(budget, investment) @@ -261,7 +261,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "Multiple nested replies", :js do + scenario "Multiple nested replies" do parent = create(:comment, :valuation, author: valuator_user, commentable: investment) 7.times do @@ -291,7 +291,7 @@ describe "Internal valuation comments on Budget::Investments" do end describe "Administrators" do - scenario "can create valuation comment as an administrator", :js do + scenario "can create valuation comment as an administrator" do login_as(admin_user) visit valuation_budget_budget_investment_path(budget, investment) @@ -307,7 +307,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "can create valuation reply as an administrator", :js do + scenario "can create valuation reply as an administrator" do comment = create(:comment, :valuation, author: valuator_user, commentable: investment) login_as(admin_user) @@ -332,7 +332,7 @@ describe "Internal valuation comments on Budget::Investments" do end end - scenario "Send email notification", :js do + scenario "Send email notification" do ActionMailer::Base.deliveries = [] login_as(admin_user) diff --git a/spec/system/comments/debates_spec.rb b/spec/system/comments/debates_spec.rb index 0b1660a59..11da98330 100644 --- a/spec/system/comments/debates_spec.rb +++ b/spec/system/comments/debates_spec.rb @@ -55,7 +55,7 @@ describe "Commenting debates" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, body: "Main comment", commentable: debate) child_comment = create(:comment, body: "First subcomment", commentable: debate, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: debate, parent: child_comment) @@ -92,7 +92,7 @@ describe "Commenting debates" do expect(page).not_to have_content grandchild_comment.body end - scenario "can collapse comments after adding a reply", :js do + scenario "can collapse comments after adding a reply" do create(:comment, body: "Main comment", commentable: debate) login_as(user) @@ -213,7 +213,7 @@ describe "Commenting debates" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit debate_path(debate) @@ -226,7 +226,7 @@ describe "Commenting debates" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit debate_path(debate) @@ -235,7 +235,7 @@ describe "Commenting debates" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") comment = create(:comment, commentable: debate, user: citizen) @@ -257,7 +257,7 @@ describe "Commenting debates" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply to reply", :js do + scenario "Reply to reply" do create(:comment, commentable: debate, body: "Any estimates?") login_as(create(:user)) @@ -282,7 +282,7 @@ describe "Commenting debates" do end end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do comment = create(:comment, commentable: debate) login_as(create(:user)) @@ -297,7 +297,7 @@ describe "Commenting debates" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do comment = create(:comment, commentable: debate) create(:comment, commentable: debate, parent: comment) @@ -314,7 +314,7 @@ describe "Commenting debates" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = create(:comment, commentable: debate, user: user) login_as(user) @@ -328,7 +328,7 @@ describe "Commenting debates" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: debate) 7.times do @@ -352,7 +352,7 @@ describe "Commenting debates" do end end - scenario "Submit button is disabled after clicking", :js do + scenario "Submit button is disabled after clicking" do debate = create(:debate) login_as(user) visit debate_path(debate) @@ -366,7 +366,7 @@ describe "Commenting debates" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do moderator = create(:moderator) login_as(moderator.user) @@ -384,7 +384,7 @@ describe "Commenting debates" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") moderator = create(:moderator, user: manuela) @@ -422,7 +422,7 @@ describe "Commenting debates" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do admin = create(:administrator) login_as(admin.user) @@ -440,7 +440,7 @@ describe "Commenting debates" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) @@ -503,7 +503,7 @@ describe "Commenting debates" do end end - scenario "Create", :js do + scenario "Create" do visit debate_path(debate) within("#comment_#{comment.id}_votes") do @@ -521,7 +521,7 @@ describe "Commenting debates" do end end - scenario "Update", :js do + scenario "Update" do visit debate_path(debate) within("#comment_#{comment.id}_votes") do @@ -545,7 +545,7 @@ describe "Commenting debates" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit debate_path(debate) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/comments/legislation_annotations_spec.rb b/spec/system/comments/legislation_annotations_spec.rb index 9d0de369d..4fe6f90e2 100644 --- a/spec/system/comments/legislation_annotations_spec.rb +++ b/spec/system/comments/legislation_annotations_spec.rb @@ -61,7 +61,7 @@ describe "Commenting legislation questions" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = legislation_annotation.comments.first child_comment = create(:comment, body: "First subcomment", commentable: legislation_annotation, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: legislation_annotation, parent: child_comment) @@ -229,7 +229,7 @@ describe "Commenting legislation questions" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit legislation_process_draft_version_annotation_path(legislation_annotation.draft_version.process, legislation_annotation.draft_version, @@ -244,7 +244,7 @@ describe "Commenting legislation questions" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit legislation_process_draft_version_annotation_path(legislation_annotation.draft_version.process, legislation_annotation.draft_version, @@ -255,7 +255,7 @@ describe "Commenting legislation questions" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") legislation_annotation = create(:legislation_annotation, author: citizen) @@ -280,7 +280,7 @@ describe "Commenting legislation questions" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do manuela = create(:user, :level_two, username: "Manuela") legislation_annotation = create(:legislation_annotation) comment = legislation_annotation.comments.first @@ -299,7 +299,7 @@ describe "Commenting legislation questions" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do manuela = create(:user, :level_two, username: "Manuela") legislation_annotation = create(:legislation_annotation) comment = legislation_annotation.comments.first @@ -320,7 +320,7 @@ describe "Commenting legislation questions" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = legislation_annotation.comments.first login_as(user) @@ -336,7 +336,7 @@ describe "Commenting legislation questions" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: legislation_annotation) 7.times do @@ -366,7 +366,7 @@ describe "Commenting legislation questions" do end end - scenario "Submit button is disabled after clicking", :js do + scenario "Submit button is disabled after clicking" do legislation_annotation = create(:legislation_annotation) login_as(user) @@ -383,7 +383,7 @@ describe "Commenting legislation questions" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do moderator = create(:moderator) login_as(moderator.user) @@ -403,7 +403,7 @@ describe "Commenting legislation questions" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") moderator = create(:moderator, user: manuela) @@ -446,7 +446,7 @@ describe "Commenting legislation questions" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do admin = create(:administrator) login_as(admin.user) @@ -466,7 +466,7 @@ describe "Commenting legislation questions" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) @@ -536,7 +536,7 @@ describe "Commenting legislation questions" do end end - scenario "Create", :js do + scenario "Create" do visit legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) @@ -556,7 +556,7 @@ describe "Commenting legislation questions" do end end - scenario "Update", :js do + scenario "Update" do visit legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) @@ -582,7 +582,7 @@ describe "Commenting legislation questions" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit legislation_process_draft_version_annotation_path(annotation.draft_version.process, annotation.draft_version, annotation) @@ -608,7 +608,7 @@ describe "Commenting legislation questions" do end end - describe "Merged comment threads", :js do + describe "Merged comment threads" do let!(:draft_version) { create(:legislation_draft_version, :published) } let!(:annotation1) do create(:legislation_annotation, draft_version: draft_version, text: "my annotation", diff --git a/spec/system/comments/legislation_questions_spec.rb b/spec/system/comments/legislation_questions_spec.rb index efc76cb65..3866376d3 100644 --- a/spec/system/comments/legislation_questions_spec.rb +++ b/spec/system/comments/legislation_questions_spec.rb @@ -60,7 +60,7 @@ describe "Commenting legislation questions" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, body: "Main comment", commentable: legislation_question) child_comment = create(:comment, body: "First subcomment", commentable: legislation_question, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: legislation_question, parent: child_comment) @@ -199,7 +199,7 @@ describe "Commenting legislation questions" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit legislation_process_question_path(legislation_question.process, legislation_question) @@ -212,7 +212,7 @@ describe "Commenting legislation questions" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit legislation_process_question_path(legislation_question.process, legislation_question) @@ -221,7 +221,7 @@ describe "Commenting legislation questions" do expect(page).to have_content "Can't be blank" end - scenario "Unverified user can't create comments", :js do + scenario "Unverified user can't create comments" do unverified_user = create :user login_as(unverified_user) @@ -230,7 +230,7 @@ describe "Commenting legislation questions" do expect(page).to have_content "To participate verify your account" end - scenario "Can't create comments if debate phase is not open", :js do + scenario "Can't create comments if debate phase is not open" do process.update!(debate_start_date: Date.current - 2.days, debate_end_date: Date.current - 1.day) login_as(user) @@ -239,7 +239,7 @@ describe "Commenting legislation questions" do expect(page).to have_content "Closed phase" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, :level_two, username: "Manuela") comment = create(:comment, commentable: legislation_question, user: citizen) @@ -261,7 +261,7 @@ describe "Commenting legislation questions" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do manuela = create(:user, :level_two, username: "Manuela") comment = create(:comment, commentable: legislation_question) @@ -277,7 +277,7 @@ describe "Commenting legislation questions" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do manuela = create(:user, :level_two, username: "Manuela") comment = create(:comment, commentable: legislation_question) create(:comment, commentable: legislation_question, parent: comment) @@ -295,7 +295,7 @@ describe "Commenting legislation questions" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = create(:comment, commentable: legislation_question, user: user) login_as(user) @@ -309,7 +309,7 @@ describe "Commenting legislation questions" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: legislation_question) 7.times do @@ -332,7 +332,7 @@ describe "Commenting legislation questions" do end end - scenario "Submit button is disabled after clicking", :js do + scenario "Submit button is disabled after clicking" do login_as(user) visit legislation_process_question_path(legislation_question.process, legislation_question) @@ -345,7 +345,7 @@ describe "Commenting legislation questions" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do moderator = create(:moderator) login_as(moderator.user) @@ -363,7 +363,7 @@ describe "Commenting legislation questions" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") moderator = create(:moderator, user: manuela) @@ -401,7 +401,7 @@ describe "Commenting legislation questions" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do admin = create(:administrator) login_as(admin.user) @@ -419,7 +419,7 @@ describe "Commenting legislation questions" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) @@ -482,7 +482,7 @@ describe "Commenting legislation questions" do end end - scenario "Create", :js do + scenario "Create" do visit legislation_process_question_path(question.process, question) within("#comment_#{comment.id}_votes") do @@ -500,7 +500,7 @@ describe "Commenting legislation questions" do end end - scenario "Update", :js do + scenario "Update" do visit legislation_process_question_path(question.process, question) within("#comment_#{comment.id}_votes") do @@ -524,7 +524,7 @@ describe "Commenting legislation questions" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit legislation_process_question_path(question.process, question) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/comments/polls_spec.rb b/spec/system/comments/polls_spec.rb index 27a4a9f0c..3eb4c94f1 100644 --- a/spec/system/comments/polls_spec.rb +++ b/spec/system/comments/polls_spec.rb @@ -54,7 +54,7 @@ describe "Commenting polls" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, body: "Main comment", commentable: poll) child_comment = create(:comment, body: "First subcomment", commentable: poll, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: poll, parent: child_comment) @@ -193,7 +193,7 @@ describe "Commenting polls" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit poll_path(poll) @@ -209,7 +209,7 @@ describe "Commenting polls" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit poll_path(poll) @@ -218,7 +218,7 @@ describe "Commenting polls" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") comment = create(:comment, commentable: poll, user: citizen) @@ -240,7 +240,7 @@ describe "Commenting polls" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do comment = create(:comment, commentable: poll) login_as(create(:user)) @@ -255,7 +255,7 @@ describe "Commenting polls" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do comment = create(:comment, commentable: poll) create(:comment, commentable: poll, parent: comment) @@ -272,7 +272,7 @@ describe "Commenting polls" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = create(:comment, commentable: poll, user: user) login_as(user) @@ -286,7 +286,7 @@ describe "Commenting polls" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: poll) 7.times do @@ -311,7 +311,7 @@ describe "Commenting polls" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do skip "Feature not implemented yet, review soon" moderator = create(:moderator) @@ -331,7 +331,7 @@ describe "Commenting polls" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do skip "Feature not implemented yet, review soon" citizen = create(:user, username: "Ana") @@ -373,7 +373,7 @@ describe "Commenting polls" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do skip "Feature not implemented yet, review soon" admin = create(:administrator) @@ -393,7 +393,7 @@ describe "Commenting polls" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do skip "Feature not implemented yet, review soon" citizen = create(:user, username: "Ana") @@ -460,7 +460,7 @@ describe "Commenting polls" do end end - scenario "Create", :js do + scenario "Create" do visit poll_path(poll) within("#comment_#{comment.id}_votes") do @@ -478,7 +478,7 @@ describe "Commenting polls" do end end - scenario "Update", :js do + scenario "Update" do visit poll_path(poll) within("#comment_#{comment.id}_votes") do @@ -502,7 +502,7 @@ describe "Commenting polls" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit poll_path(poll) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/comments/proposals_spec.rb b/spec/system/comments/proposals_spec.rb index 61224294a..29805c4ed 100644 --- a/spec/system/comments/proposals_spec.rb +++ b/spec/system/comments/proposals_spec.rb @@ -54,7 +54,7 @@ describe "Commenting proposals" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do parent_comment = create(:comment, body: "Main comment", commentable: proposal) child_comment = create(:comment, body: "First subcomment", commentable: proposal, parent: parent_comment) grandchild_comment = create(:comment, body: "Last subcomment", commentable: proposal, parent: child_comment) @@ -193,7 +193,7 @@ describe "Commenting proposals" do end end - scenario "Create", :js do + scenario "Create" do login_as(user) visit proposal_path(proposal) @@ -209,7 +209,7 @@ describe "Commenting proposals" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do login_as(user) visit proposal_path(proposal) @@ -218,7 +218,7 @@ describe "Commenting proposals" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") comment = create(:comment, commentable: proposal, user: citizen) @@ -240,7 +240,7 @@ describe "Commenting proposals" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do comment = create(:comment, commentable: proposal) login_as(create(:user)) @@ -255,7 +255,7 @@ describe "Commenting proposals" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do comment = create(:comment, commentable: proposal) create(:comment, commentable: proposal, parent: comment) @@ -272,7 +272,7 @@ describe "Commenting proposals" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do comment = create(:comment, commentable: proposal, user: user) login_as(user) @@ -286,7 +286,7 @@ describe "Commenting proposals" do end end - scenario "N replies", :js do + scenario "N replies" do parent = create(:comment, commentable: proposal) 7.times do @@ -311,7 +311,7 @@ describe "Commenting proposals" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do moderator = create(:moderator) login_as(moderator.user) @@ -329,7 +329,7 @@ describe "Commenting proposals" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") moderator = create(:moderator, user: manuela) @@ -367,7 +367,7 @@ describe "Commenting proposals" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do admin = create(:administrator) login_as(admin.user) @@ -385,7 +385,7 @@ describe "Commenting proposals" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do citizen = create(:user, username: "Ana") manuela = create(:user, username: "Manuela") admin = create(:administrator, user: manuela) @@ -448,7 +448,7 @@ describe "Commenting proposals" do end end - scenario "Create", :js do + scenario "Create" do visit proposal_path(proposal) within("#comment_#{comment.id}_votes") do @@ -466,7 +466,7 @@ describe "Commenting proposals" do end end - scenario "Update", :js do + scenario "Update" do visit proposal_path(proposal) within("#comment_#{comment.id}_votes") do @@ -490,7 +490,7 @@ describe "Commenting proposals" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit proposal_path(proposal) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/comments/topics_spec.rb b/spec/system/comments/topics_spec.rb index dcffeaa98..c4a021c7f 100644 --- a/spec/system/comments/topics_spec.rb +++ b/spec/system/comments/topics_spec.rb @@ -57,7 +57,7 @@ describe "Commenting topics from proposals" do expect(page).to have_current_path(comment_path(comment)) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do community = proposal.community topic = create(:topic, community: community) parent_comment = create(:comment, body: "Main comment", commentable: topic) @@ -211,7 +211,7 @@ describe "Commenting topics from proposals" do end end - scenario "Create", :js do + scenario "Create" do community = proposal.community topic = create(:topic, community: community) @@ -230,7 +230,7 @@ describe "Commenting topics from proposals" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do community = proposal.community topic = create(:topic, community: community) @@ -242,7 +242,7 @@ describe "Commenting topics from proposals" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do community = proposal.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -266,7 +266,7 @@ describe "Commenting topics from proposals" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Reply update parent comment responses count", :js do + scenario "Reply update parent comment responses count" do community = proposal.community topic = create(:topic, community: community) comment = create(:comment, commentable: topic) @@ -283,7 +283,7 @@ describe "Commenting topics from proposals" do end end - scenario "Reply show parent comments responses when hidden", :js do + scenario "Reply show parent comments responses when hidden" do community = proposal.community topic = create(:topic, community: community) comment = create(:comment, commentable: topic) @@ -302,7 +302,7 @@ describe "Commenting topics from proposals" do end end - scenario "Errors on reply", :js do + scenario "Errors on reply" do community = proposal.community topic = create(:topic, community: community) comment = create(:comment, commentable: topic, user: user) @@ -318,7 +318,7 @@ describe "Commenting topics from proposals" do end end - scenario "N replies", :js do + scenario "N replies" do community = proposal.community topic = create(:topic, community: community) parent = create(:comment, commentable: topic) @@ -347,7 +347,7 @@ describe "Commenting topics from proposals" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do community = proposal.community topic = create(:topic, community: community) moderator = create(:moderator) @@ -367,7 +367,7 @@ describe "Commenting topics from proposals" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do community = proposal.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -409,7 +409,7 @@ describe "Commenting topics from proposals" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do community = proposal.community topic = create(:topic, community: community) admin = create(:administrator) @@ -429,7 +429,7 @@ describe "Commenting topics from proposals" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do community = proposal.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -498,7 +498,7 @@ describe "Commenting topics from proposals" do end end - scenario "Create", :js do + scenario "Create" do visit community_topic_path(proposal.community, topic) within("#comment_#{comment.id}_votes") do @@ -516,7 +516,7 @@ describe "Commenting topics from proposals" do end end - scenario "Update", :js do + scenario "Update" do visit community_topic_path(proposal.community, topic) within("#comment_#{comment.id}_votes") do @@ -540,7 +540,7 @@ describe "Commenting topics from proposals" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit community_topic_path(proposal.community, topic) within("#comment_#{comment.id}_votes") do @@ -604,7 +604,7 @@ describe "Commenting topics from budget investments" do expect(page).to have_link "Go back to #{topic.title}", href: community_topic_path(community, topic) end - scenario "Collapsable comments", :js do + scenario "Collapsable comments" do community = investment.community topic = create(:topic, community: community) parent_comment = create(:comment, body: "Main comment", commentable: topic) @@ -753,7 +753,7 @@ describe "Commenting topics from budget investments" do end end - scenario "Create", :js do + scenario "Create" do community = investment.community topic = create(:topic, community: community) @@ -772,7 +772,7 @@ describe "Commenting topics from budget investments" do end end - scenario "Errors on create", :js do + scenario "Errors on create" do community = investment.community topic = create(:topic, community: community) @@ -784,7 +784,7 @@ describe "Commenting topics from budget investments" do expect(page).to have_content "Can't be blank" end - scenario "Reply", :js do + scenario "Reply" do community = investment.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -808,7 +808,7 @@ describe "Commenting topics from budget investments" do expect(page).not_to have_selector("#js-comment-form-comment_#{comment.id}") end - scenario "Errors on reply", :js do + scenario "Errors on reply" do community = investment.community topic = create(:topic, community: community) comment = create(:comment, commentable: topic, user: user) @@ -824,7 +824,7 @@ describe "Commenting topics from budget investments" do end end - scenario "N replies", :js do + scenario "N replies" do community = investment.community topic = create(:topic, community: community) parent = create(:comment, commentable: topic) @@ -853,7 +853,7 @@ describe "Commenting topics from budget investments" do end describe "Moderators" do - scenario "can create comment as a moderator", :js do + scenario "can create comment as a moderator" do community = investment.community topic = create(:topic, community: community) moderator = create(:moderator) @@ -873,7 +873,7 @@ describe "Commenting topics from budget investments" do end end - scenario "can create reply as a moderator", :js do + scenario "can create reply as a moderator" do community = investment.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -915,7 +915,7 @@ describe "Commenting topics from budget investments" do end describe "Administrators" do - scenario "can create comment as an administrator", :js do + scenario "can create comment as an administrator" do community = investment.community topic = create(:topic, community: community) admin = create(:administrator) @@ -935,7 +935,7 @@ describe "Commenting topics from budget investments" do end end - scenario "can create reply as an administrator", :js do + scenario "can create reply as an administrator" do community = investment.community topic = create(:topic, community: community) citizen = create(:user, username: "Ana") @@ -1004,7 +1004,7 @@ describe "Commenting topics from budget investments" do end end - scenario "Create", :js do + scenario "Create" do visit community_topic_path(investment.community, topic) within("#comment_#{comment.id}_votes") do @@ -1022,7 +1022,7 @@ describe "Commenting topics from budget investments" do end end - scenario "Update", :js do + scenario "Update" do visit community_topic_path(investment.community, topic) within("#comment_#{comment.id}_votes") do @@ -1046,7 +1046,7 @@ describe "Commenting topics from budget investments" do end end - scenario "Trying to vote multiple times", :js do + scenario "Trying to vote multiple times" do visit community_topic_path(investment.community, topic) within("#comment_#{comment.id}_votes") do diff --git a/spec/system/communities_spec.rb b/spec/system/communities_spec.rb index 5e07d6367..422260512 100644 --- a/spec/system/communities_spec.rb +++ b/spec/system/communities_spec.rb @@ -2,7 +2,7 @@ require "rails_helper" describe "Communities" do context "Show" do - scenario "Should display default content", :js do + scenario "Should display default content" do proposal = create(:proposal) community = proposal.community user = create(:user) diff --git a/spec/system/dashboard/dashboard_spec.rb b/spec/system/dashboard/dashboard_spec.rb index adc9aa45a..319f0f6c5 100644 --- a/spec/system/dashboard/dashboard_spec.rb +++ b/spec/system/dashboard/dashboard_spec.rb @@ -23,7 +23,7 @@ describe "Proposal's dashboard" do expect(page).not_to have_link("Publish proposal") end - scenario "Dashboard progress shows current goal", js: true do + scenario "Dashboard progress shows current goal" do goal = create(:dashboard_action, :resource, :active, required_supports: proposal.votes_for.size + 1_000) future_goal = create(:dashboard_action, :resource, :active, @@ -71,7 +71,7 @@ describe "Proposal's dashboard" do expect(page).to have_button("Show description") end - scenario "Dashboard progress do not display from the fourth proposed actions", js: true do + scenario "Dashboard progress do not display from the fourth proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) action_5 = create(:dashboard_action, :proposed_action, :active) @@ -81,7 +81,7 @@ describe "Proposal's dashboard" do end scenario "Dashboard progress display link to new page for proposed actions when - there are more than four proposed actions", js: true do + there are more than four proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) create(:dashboard_action, :proposed_action, :active) @@ -91,7 +91,7 @@ describe "Proposal's dashboard" do end scenario "Dashboard progress do not display link to new page for proposed actions - when there are less than five proposed actions", js: true do + when there are less than five proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) visit progress_proposal_dashboard_path(proposal) @@ -262,7 +262,7 @@ describe "Proposal's dashboard" do expect(page).to have_link(feature.title) end - scenario "Request resource with admin request", js: true do + scenario "Request resource with admin request" do feature = create(:dashboard_action, :resource, :active, :admin_request) visit proposal_dashboard_path(proposal) @@ -273,7 +273,7 @@ describe "Proposal's dashboard" do "as soon as possible to inform you about it.") end - scenario "Request already requested resource with admin request", js: true do + scenario "Request already requested resource with admin request" do feature = create(:dashboard_action, :resource, :active, :admin_request) visit proposal_dashboard_path(proposal) @@ -298,7 +298,7 @@ describe "Proposal's dashboard" do "as soon as possible to inform you about it.") end - scenario "Resource without admin request do not have a request link", js: true do + scenario "Resource without admin request do not have a request link" do feature = create(:dashboard_action, :resource, :active) visit proposal_dashboard_path(proposal) @@ -323,9 +323,10 @@ describe "Proposal's dashboard" do expect(page).to have_content("This proposal is archived and can not request resources.") end - scenario "Dashboard has a link to dashboard community", js: true do + scenario "Dashboard has a link to dashboard community" do visit proposal_dashboard_path(proposal) + expect(page).to have_link("Community") click_link "Community" expect(page).to have_content("Participants") @@ -334,7 +335,7 @@ describe "Proposal's dashboard" do expect(page).to have_link("Access the community") end - scenario "Dashboard has a link to recommended_actions if there is any", js: true do + scenario "Dashboard has a link to recommended_actions if there is any" do expect(page).not_to have_link("Recommended actions") create_list(:dashboard_action, 3, :proposed_action, :active) @@ -379,7 +380,7 @@ describe "Proposal's dashboard" do anchor: "tab-notifications")) end - scenario "Dashboard has a related content section", :js do + scenario "Dashboard has a related content section" do related_debate = create(:debate) related_proposal = create(:proposal) @@ -407,7 +408,7 @@ describe "Proposal's dashboard" do end scenario "On recommended actions section display from the fourth proposed actions - when click see_proposed_actions_link", js: true do + when click see_proposed_actions_link" do create_list(:dashboard_action, 4, :proposed_action, :active) action_5 = create(:dashboard_action, :proposed_action, :active) @@ -421,7 +422,7 @@ describe "Proposal's dashboard" do expect(page).not_to have_content(action_5.title) end - scenario "On recommended actions section display four proposed actions", js: true do + scenario "On recommended actions section display four proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) action_5 = create(:dashboard_action, :proposed_action, :active) @@ -431,7 +432,7 @@ describe "Proposal's dashboard" do end scenario "On recommended actions section display link for toggle when there are - more than four proposed actions", js: true do + more than four proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) create(:dashboard_action, :proposed_action, :active) @@ -441,7 +442,7 @@ describe "Proposal's dashboard" do end scenario "On recommended actions section do not display link for toggle when - there are less than five proposed actions", js: true do + there are less than five proposed actions" do create_list(:dashboard_action, 4, :proposed_action, :active) visit recommended_actions_proposal_dashboard_path(proposal.to_param) diff --git a/spec/system/dashboard/polls_spec.rb b/spec/system/dashboard/polls_spec.rb index 9de22d6b6..f8749d93b 100644 --- a/spec/system/dashboard/polls_spec.rb +++ b/spec/system/dashboard/polls_spec.rb @@ -12,7 +12,7 @@ describe "Polls" do expect(page).to have_link("Polls") end - scenario "Create a poll", :js do + scenario "Create a poll" do click_link "Polls" click_link "Create poll" @@ -41,7 +41,7 @@ describe "Polls" do expect(page).to have_content I18n.l(start_date.to_date) end - describe "Datepicker", :js do + describe "Datepicker" do scenario "displays the expected format when changing the date field" do visit new_proposal_dashboard_poll_path(proposal) @@ -79,7 +79,7 @@ describe "Polls" do end end - scenario "Create a poll redirects back to form when invalid data", js: true do + scenario "Create a poll redirects back to form when invalid data" do click_link "Polls" click_link "Create poll" @@ -104,7 +104,7 @@ describe "Polls" do expect(page).to have_content "Poll updated successfully" end - scenario "Edit poll redirects back when invalid data", js: true do + scenario "Edit poll redirects back when invalid data" do poll = create(:poll, related: proposal, starts_at: 1.week.from_now) visit proposal_dashboard_polls_path(proposal) @@ -142,7 +142,7 @@ describe "Polls" do end end - scenario "Edit poll should allow to remove questions", :js do + scenario "Edit poll should allow to remove questions" do poll = create(:poll, related: proposal, starts_at: 1.week.from_now) create(:poll_question, poll: poll) create(:poll_question, poll: poll) @@ -165,7 +165,7 @@ describe "Polls" do expect(page).to have_css ".nested-fields", count: 1 end - scenario "Edit poll should allow to remove answers", :js do + scenario "Edit poll should allow to remove answers" do poll = create(:poll, related: proposal, starts_at: 1.week.from_now) create(:poll_question, :yes_no, poll: poll) visit proposal_dashboard_polls_path(proposal) @@ -189,7 +189,7 @@ describe "Polls" do end end - scenario "Can destroy poll without responses", :js do + scenario "Can destroy poll without responses" do poll = create(:poll, related: proposal) visit proposal_dashboard_polls_path(proposal) @@ -202,7 +202,7 @@ describe "Polls" do expect(page).not_to have_content(poll.name) end - scenario "Can't destroy poll with responses", :js do + scenario "Can't destroy poll with responses" do poll = create(:poll, related: proposal) create(:poll_question, poll: poll) create(:poll_voter, poll: poll) @@ -247,7 +247,7 @@ describe "Polls" do end end - scenario "View results redirects to results in public zone", js: true do + scenario "View results redirects to results in public zone" do poll = create(:poll, :expired, related: proposal) visit proposal_dashboard_polls_path(proposal) @@ -261,7 +261,7 @@ describe "Polls" do end end - scenario "Enable and disable results", :js do + scenario "Enable and disable results" do create(:poll, related: proposal) visit proposal_dashboard_polls_path(proposal) diff --git a/spec/system/dashboard/poster_spec.rb b/spec/system/dashboard/poster_spec.rb index 5f8deb1b7..f63333741 100644 --- a/spec/system/dashboard/poster_spec.rb +++ b/spec/system/dashboard/poster_spec.rb @@ -30,7 +30,7 @@ describe "Poster" do expect(page).to have_link("Download") end - scenario "PDF contains the proposal details", js: true do + scenario "PDF contains the proposal details" do click_link "Download" page.driver.browser.switch_to.window page.driver.browser.window_handles.last do diff --git a/spec/system/debates_spec.rb b/spec/system/debates_spec.rb index f32ebae1d..60ee384dc 100644 --- a/spec/system/debates_spec.rb +++ b/spec/system/debates_spec.rb @@ -90,7 +90,7 @@ describe "Debates" do expect(page.html).to include "