added li membership
This commit is contained in:
@@ -18,6 +18,6 @@ class SupportersController < ApplicationController
|
||||
private
|
||||
|
||||
def supporter_form_params
|
||||
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :age_category, :city, :comments)
|
||||
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :li_membership, :age_category, :city, :comments)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,6 +15,7 @@ class Supporter
|
||||
field :city, type: String
|
||||
field :email, type: String
|
||||
field :support, type: String # Indicates the type of support
|
||||
field :li_membership, type: Boolean
|
||||
field :age_category, type: String
|
||||
field :coordinates, type: Array
|
||||
field :comments, type: String
|
||||
|
||||
@@ -10,6 +10,7 @@ h1 = title t('.title_html')
|
||||
= f.input :zip, placeholder: t('.placeholders.zip')
|
||||
= f.input :email, placeholder: t('.placeholders.email')
|
||||
= f.input :support, as: :radio_buttons, collection: t('support_type').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first
|
||||
= f.input :li_membership, as: :boolean
|
||||
= f.input :age_category, as: :radio_buttons, collection: t('age_category'), label_method: :last, value_method: :first
|
||||
= f.input :comments, as: :text
|
||||
.form-group
|
||||
|
||||
@@ -42,4 +42,5 @@ de:
|
||||
email: E-Mail
|
||||
support: Unterstützung
|
||||
age_category: Alterskategorie
|
||||
li_membership: Ich bin interessiert an einer Mitgliedschaft beim Verein Legalize it! (50 Franken pro Jahr)
|
||||
comments: Kommentar / Feedback (optional)
|
||||
|
||||
@@ -17,11 +17,14 @@ feature 'Support announcement' do
|
||||
|
||||
choose 'Ich bin über 64 Jahre alt'
|
||||
|
||||
check 'Ich bin interessiert an einer Mitgliedschaft beim Verein Legalize it! (50 Franken pro Jahr)'
|
||||
|
||||
expect { click_button 'Unterstützung zusichern' }.to change { Supporter.count }.by(1)
|
||||
supporter = Supporter.find_by(email: 'blocher@blocher.ch')
|
||||
expect(supporter.coordinates).to eq [8.618589100000001, 47.2926304]
|
||||
expect(supporter.comments).to eq 'Test text'
|
||||
expect(supporter.language).to eq 'de'
|
||||
expect(supporter.li_membership).to eq true
|
||||
end
|
||||
|
||||
scenario 'A bot tries to enter data' do
|
||||
|
||||
Reference in New Issue
Block a user