From c03acf97ffe6423ecf1068bb47db68acaae51af3 Mon Sep 17 00:00:00 2001
From: quentinchampenois <26109239+Quentinchampenois@users.noreply.github.com>
Date: Mon, 11 Dec 2023 13:54:40 +0100
Subject: [PATCH] revert: "feat: Add newsletter to registration form (#152)"
This reverts commit 585fd97148299efda994d2fe745bb53f06d88d74.
---
app/forms/decidim/registration_form.rb | 1 -
app/views/decidim/devise/registrations/new.html.erb | 13 -------------
.../examples/registration_password_examples.rb | 7 ++-----
3 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/app/forms/decidim/registration_form.rb b/app/forms/decidim/registration_form.rb
index 7b4e44b8..45da1691 100644
--- a/app/forms/decidim/registration_form.rb
+++ b/app/forms/decidim/registration_form.rb
@@ -24,7 +24,6 @@ class RegistrationForm < Form
attribute :metropolis_residential_area, String
attribute :metropolis_work_area, String
attribute :gender, String
- attribute :newsletter, Boolean
attribute :tos_agreement, Boolean
attribute :additional_tos, Boolean
attribute :current_locale, String
diff --git a/app/views/decidim/devise/registrations/new.html.erb b/app/views/decidim/devise/registrations/new.html.erb
index 63b1cbf3..a8c376dd 100644
--- a/app/views/decidim/devise/registrations/new.html.erb
+++ b/app/views/decidim/devise/registrations/new.html.erb
@@ -142,19 +142,6 @@
-
-
-
-
-
-
- <%= f.check_box :newsletter, label: t(".newsletter"), checked: @form.newsletter %>
-
-
-
-
-
-
diff --git a/spec/system/examples/registration_password_examples.rb b/spec/system/examples/registration_password_examples.rb
index 61563dce..ce182e37 100644
--- a/spec/system/examples/registration_password_examples.rb
+++ b/spec/system/examples/registration_password_examples.rb
@@ -34,7 +34,7 @@
expect(page).to have_field("registration_user_nickname", with: "")
expect(page).to have_field("registration_user_email", with: "")
expect(page).to have_field("registration_user_password", with: "")
- expect(page).to have_field("registration_user_newsletter", checked: false)
+ expect(page).not_to have_field("registration_user_newsletter", checked: false)
end
it "creates a new User" do
@@ -84,7 +84,6 @@
check :registration_user_tos_agreement
check :registration_user_additional_tos
- check :registration_user_newsletter
check :registration_user_additional_tos
find("*[type=submit]").click
@@ -108,7 +107,7 @@
expect(page).to have_field("registration_user_email", with: "")
expect(page).to have_field("registration_user_password", with: "")
expect(page).to have_field("registration_user_password_confirmation", with: "")
- expect(page).to have_field("registration_user_newsletter", checked: false)
+ expect(page).not_to have_field("registration_user_newsletter", checked: false)
end
it "creates a new User" do
@@ -127,7 +126,6 @@
select "1992", from: :registration_user_year
fill_in :registration_user_password_confirmation, with: "nonsense"
- check :registration_user_newsletter
check :registration_user_tos_agreement
check :registration_user_additional_tos
find("*[type=submit]").click
@@ -164,7 +162,6 @@
select "1992", from: :registration_user_year
fill_in :registration_user_password_confirmation, with: "DfyvHn425mYAy2HL"
- check :registration_user_newsletter
check :registration_user_tos_agreement
check :registration_user_additional_tos
check :registration_user_newsletter