diff --git a/app/models/proposal.rb b/app/models/proposal.rb index ff5479ad8..dfc81e2ea 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -38,14 +38,12 @@ class Proposal < ApplicationRecord has_many :polls, as: :related validates :title, presence: true - validates :question, presence: true validates :summary, presence: true validates :author, presence: true validates :responsible_name, presence: true, unless: :skip_user_verification? validates :title, length: { in: 4..Proposal.title_max_length } validates :description, length: { maximum: Proposal.description_max_length } - validates :question, length: { in: 10..Proposal.question_max_length } validates :responsible_name, length: { in: 6..Proposal.responsible_name_max_length }, unless: :skip_user_verification? validates :retired_reason, inclusion: { in: RETIRE_OPTIONS, allow_nil: true } diff --git a/app/views/proposals/_form.html.erb b/app/views/proposals/_form.html.erb index 102c785e1..f7a5e57f9 100644 --- a/app/views/proposals/_form.html.erb +++ b/app/views/proposals/_form.html.erb @@ -10,17 +10,6 @@ <%= f.invisible_captcha :subtitle %> -
- <%= t("proposals.form.proposal_question_example_html") %> -
- <%= f.text_field :question, maxlength: Proposal.question_max_length, - placeholder: t("proposals.form.proposal_question"), - label: false, - aria: {describedby: "question-help-text"} %> -<%= t("proposals.form.proposal_summary_note") %>
diff --git a/lib/tasks/proposal_actions.rake b/lib/tasks/proposal_actions.rake index fc914a8b5..f18d2f3a0 100644 --- a/lib/tasks/proposal_actions.rake +++ b/lib/tasks/proposal_actions.rake @@ -415,10 +415,8 @@ namespace :proposal_actions do description = "This is an example of a successful proposal with an ideal progress.
" proposal = Proposal.create!(author: author, title: Faker::Lorem.sentence(3).truncate(60), - question: Faker::Lorem.sentence(3) + "?", summary: Faker::Lorem.sentence(3), responsible_name: Faker::Name.name, - external_url: Faker::Internet.url, description: description, created_at: Time.now - expected_supports.length.days, tag_list: "Example", diff --git a/spec/features/management/proposals_spec.rb b/spec/features/management/proposals_spec.rb index 4475fbdd6..6e17e1dfc 100644 --- a/spec/features/management/proposals_spec.rb +++ b/spec/features/management/proposals_spec.rb @@ -22,7 +22,6 @@ feature "Proposals" do end fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yRYFKcMa_Ek" @@ -33,7 +32,6 @@ feature "Proposals" do expect(page).to have_content "Proposal created successfully." expect(page).to have_content "Help refugees" - expect(page).to have_content "¿Would you like to give assistance to war refugees?" expect(page).to have_content "In summary, what we want is..." expect(page).to have_content "This is very important because..." expect(page).to have_content "https://www.youtube.com/watch?v=yRYFKcMa_Ek" diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 8203c9421..c230a9422 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -125,7 +125,6 @@ feature "Proposals" do expect(page).to have_content proposal.title expect(page).to have_content proposal.code - expect(page).to have_content "Proposal question" expect(page).to have_content "Proposal description" expect(page).to have_content proposal.author.name expect(page).to have_content I18n.l(proposal.created_at.to_date) @@ -218,7 +217,6 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" @@ -238,7 +236,6 @@ feature "Proposals" do click_link "Not now, go to my proposal" expect(page).to have_content "Help refugees" - expect(page).to have_content "¿Would you like to give assistance to war refugees?" expect(page).to have_content "In summary, what we want is..." expect(page).to have_content "This is very important because..." expect(page).to have_content "https://www.youtube.com/watch?v=yPQfcG-eimk" @@ -255,7 +252,6 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "I am a bot" fill_in "proposal_subtitle", with: "This is the honeypot field" - fill_in "proposal_question", with: "This is a question" fill_in "proposal_summary", with: "This is the summary" fill_in "proposal_description", with: "This is the description" fill_in "proposal_responsible_name", with: "Some other robot" @@ -276,10 +272,8 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "I am a bot" - fill_in "proposal_question", with: "This is a question" fill_in "proposal_summary", with: "This is the summary" fill_in "proposal_description", with: "This is the description" - fill_in "proposal_external_url", with: "http://google.com/robots.txt" fill_in "proposal_responsible_name", with: "Some other robot" check "proposal_terms_of_service" @@ -296,10 +290,8 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." - fill_in "proposal_external_url", with: "http://rescue.org/refugees" fill_in "proposal_responsible_name", with: "Isabel Garcia" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -321,7 +313,6 @@ feature "Proposals" do expect(page).not_to have_selector("#proposal_responsible_name") fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." check "proposal_terms_of_service" @@ -350,10 +341,8 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Testing an attack" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is
" - fill_in "proposal_external_url", with: "http://rescue.org/refugees" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -375,7 +364,6 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Testing auto link" - fill_in "proposal_question", with: "Should I stay or should I go?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is a link www.example.org
" fill_in "proposal_responsible_name", with: "Isabel Garcia" @@ -398,7 +386,6 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Testing auto link" - fill_in "proposal_question", with: "Should I stay or should I go?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: js_injection_string fill_in "proposal_responsible_name", with: "Isabel Garcia" @@ -435,13 +422,7 @@ feature "Proposals" do login_as(author) visit new_proposal_path - - fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_summary", with: "In summary what we want is..." - fill_in_ckeditor "proposal_description", with: "A description with enough characters" - fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" - fill_in "proposal_responsible_name", with: "Isabel Garcia" - check "proposal_terms_of_service" + fill_in_proposal click_button "Create proposal" @@ -463,10 +444,8 @@ feature "Proposals" do visit new_proposal_path fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." - fill_in "proposal_external_url", with: "http://rescue.org/refugees" fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_responsible_name", with: "Isabel Garcia" check "proposal_terms_of_service" @@ -622,7 +601,6 @@ feature "Proposals" do expect(page).to have_current_path(edit_proposal_path(proposal)) fill_in "proposal_title", with: "End child poverty" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "Basically..." fill_in "proposal_description", with: "Let's do something to end child poverty" fill_in "proposal_responsible_name", with: "Isabel Garcia" @@ -1825,7 +1803,6 @@ feature "Successful proposals" do fill_in "proposal_title", with: "Help refugees" fill_in "proposal_summary", with: "In summary what we want is..." - fill_in "proposal_question", with: "Would you like to?" fill_in "proposal_description", with: "This is very important because..." fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" fill_in "proposal_tag_list", with: "Refugees, Solidarity" diff --git a/spec/features/tags/proposals_spec.rb b/spec/features/tags/proposals_spec.rb index 6aec4910c..a0e1cd690 100644 --- a/spec/features/tags/proposals_spec.rb +++ b/spec/features/tags/proposals_spec.rb @@ -70,7 +70,6 @@ feature "Tags" do visit new_proposal_path fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "This is very important because..." fill_in "proposal_responsible_name", with: "Isabel Garcia" @@ -97,7 +96,6 @@ feature "Tags" do visit new_proposal_path fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in_ckeditor "proposal_description", with: "A description with enough characters" fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=Ae6gQmhaMn4" @@ -141,7 +139,6 @@ feature "Tags" do visit new_proposal_path fill_in "proposal_title", with: "A test of dangerous strings" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." fill_in "proposal_description", with: "A description suitable for this test" fill_in "proposal_responsible_name", with: "Isabel Garcia" diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 2eb777d5d..e9d316350 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -54,23 +54,6 @@ describe Proposal do end end - describe "#question" do - it "is not valid without a question" do - proposal.question = nil - expect(proposal).not_to be_valid - end - - it "is not valid when very short" do - proposal.question = "abc" - expect(proposal).not_to be_valid - end - - it "is not valid when very long" do - proposal.question = "a" * 141 - expect(proposal).not_to be_valid - end - end - describe "#video_url" do it "is not valid when URL is not from Youtube or Vimeo" do proposal.video_url = "https://twitter.com" diff --git a/spec/shared/features/mappable.rb b/spec/shared/features/mappable.rb index ecbc5789b..bce1071f3 100644 --- a/spec/shared/features/mappable.rb +++ b/spec/shared/features/mappable.rb @@ -250,7 +250,6 @@ end def fill_in_proposal_form fill_in "proposal_title", with: "Help refugees" - fill_in "proposal_question", with: "¿Would you like to give assistance to war refugees?" fill_in "proposal_summary", with: "In summary, what we want is..." end diff --git a/spec/shared/features/nested_documentable.rb b/spec/shared/features/nested_documentable.rb index b3febed10..e07b26680 100644 --- a/spec/shared/features/nested_documentable.rb +++ b/spec/shared/features/nested_documentable.rb @@ -365,7 +365,6 @@ end def documentable_fill_new_valid_proposal fill_in :proposal_title, with: "Proposal title #{rand(9999)}" fill_in :proposal_summary, with: "Proposal summary" - fill_in :proposal_question, with: "Proposal question?" check :proposal_terms_of_service end diff --git a/spec/shared/features/nested_imageable.rb b/spec/shared/features/nested_imageable.rb index a4a37adb2..1e5d9ec34 100644 --- a/spec/shared/features/nested_imageable.rb +++ b/spec/shared/features/nested_imageable.rb @@ -291,7 +291,6 @@ end def imageable_fill_new_valid_proposal fill_in :proposal_title, with: "Proposal title" fill_in :proposal_summary, with: "Proposal summary" - fill_in :proposal_question, with: "Proposal question?" check :proposal_terms_of_service end diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index 118508119..efabd1532 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -26,6 +26,15 @@ module CommonActions to receive(:verify_officer_assignment).and_return(true) end + def fill_in_proposal + fill_in "proposal_title", with: "Help refugees" + fill_in "proposal_summary", with: "In summary what we want is..." + fill_in "proposal_description", with: "This is very important because..." + fill_in "proposal_video_url", with: "https://www.youtube.com/watch?v=yPQfcG-eimk" + fill_in "proposal_responsible_name", with: "Isabel Garcia" + check "proposal_terms_of_service" + end + def set_officing_booth(booth=nil) booth = create(:poll_booth) if booth.blank?