diff --git a/spec/features/consumer/registration_spec.rb b/spec/features/consumer/registration_spec.rb index 4a7b815737..6bcf85486b 100644 --- a/spec/features/consumer/registration_spec.rb +++ b/spec/features/consumer/registration_spec.rb @@ -6,7 +6,20 @@ feature "Registration", js: true do describe "Registering a Profile" do let(:user) { create(:user, password: "password", password_confirmation: "password") } - before { Spree::Config.enterprises_require_tos = false } + + before do + Spree::Config.enterprises_require_tos = false + + albania = Spree::Country.create!({ name: "Albania", iso3: "ALB", iso: "AL", iso_name: "ALBANIA", numcode: "8" }, without_protection: true) + Spree::State.create!({ name: "Berat", abbr: "BRA", country: albania }, without_protection: true) + Spree::Country.create!({ name: "Chad", iso3: "TCD", iso: "TD", iso_name: "CHAD", numcode: "148" }, without_protection: true) + end + + after do + Spree::State.where(name: 'Berat').delete_all + Spree::Country.where(name: 'Albania').delete_all + Spree::Country.where(name: 'Chad').delete_all + end it "Allows a logged in user to register a profile" do visit registration_path @@ -35,6 +48,7 @@ feature "Registration", js: true do fill_in 'enterprise_address', with: '123 Abc Street' fill_in 'enterprise_city', with: 'Northcote' fill_in 'enterprise_zipcode', with: '3070' + expect(page).to have_select('enterprise_country', options: %w(Albania Australia Chad), selected: 'Albania') select 'Australia', from: 'enterprise_country' select 'VIC', from: 'enterprise_state' perform_and_ensure(:click_button, "Continue", lambda { page.has_content? 'Who is responsible for managing My Awesome Enterprise?' })