diff --git a/app/controllers/hackathons/submissions_controller.rb b/app/controllers/hackathons/submissions_controller.rb index b39b9e60..ad9f3498 100644 --- a/app/controllers/hackathons/submissions_controller.rb +++ b/app/controllers/hackathons/submissions_controller.rb @@ -13,12 +13,10 @@ def new end def create - requested_swag = params[:requested_swag] == "1" offers_financial_assistance = params[:hackathon][:offers_financial_assistance] == "true" @hackathon = Hackathon.new(hackathon_params) - @hackathon.swag_mailing_address = nil unless requested_swag @hackathon.tag_with! "Offers Financial Assistance" if offers_financial_assistance @hackathon.applicant = User.find_or_initialize_by(email_address: applicant_params[:email_address]) do |user| @@ -54,16 +52,7 @@ def hackathon_params :postal_code, :country_code, :expected_attendees, - :high_school_led, - # Swag - swag_mailing_address_attributes: [ - :line1, - :line2, - :city, - :province, - :postal_code, - :country_code - ] + :high_school_led ) end diff --git a/test/system/hackathon_submission_test.rb b/test/system/hackathon_submission_test.rb index b95fdf1a..e4796453 100644 --- a/test/system/hackathon_submission_test.rb +++ b/test/system/hackathon_submission_test.rb @@ -54,36 +54,4 @@ class HackathonSubmissionTest < ApplicationSystemTestCase assert_equal "Assemble", Hackathon.last.name assert_not Hackathon.last.requested_swag? end - - test "submitting a hackathon wanting swag" do - visit new_hackathons_submission_path - - fill_in "Your name", with: "Gary" - fill_in "Email address", with: "not.a.user.yet@hey.test" - select "No", from: "Are you a high schooler?" - - fill_in "Name of the hackathon", with: "Assemble" - fill_in "Start date", with: 1.month.from_now.beginning_of_minute - fill_in "End date", with: (1.month.from_now + 2.days).beginning_of_minute - fill_in "Website", with: "https://assemble.hackclub.com" - - attach_file "Logo", Rails.root.join("test/fixtures/files/assemble_logo.jpg") - attach_file "Banner", Rails.root.join("test/fixtures/files/assemble.jpg") - - select "In Person", from: "Where is the hackathon taking place?" - fill_in "Street", with: "760 Market St" - fill_in "City", with: "San Francisco" - fill_in "State/Province", with: "CA" - fill_in "ZIP/Postal Code", with: "94102" - select "United States", from: "Country" - - fill_in :hackathon_expected_attendees, with: 100 - - select "Yes", from: :hackathon_offers_financial_assistance - - assert_difference -> { Hackathon.count } do - click_on "Submit for Review" - assert_text(/submitted/i) - end - end end