From a54546976dcdaec70444794915b99ae873d1f288 Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 4 Sep 2017 20:25:22 -0700 Subject: [PATCH] Fixed failing tests --- app/controllers/conferences_controller.rb | 7 ++++++- features/support/factory_girl.rb | 4 ++++ features/support/location_cache.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index f9791c5..c7c1eb9 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -78,7 +78,7 @@ class ConferencesController < ApplicationController return redirect_to pp_response.redirect_uri end end - +begin # get the current step @step = current_registration_step(@this_conference, current_user) @@ -97,6 +97,11 @@ class ConferencesController < ApplicationController result = registration_step(@step, @this_conference, current_user) # pass any data on to the view data_to_instance_variables(result) +rescue Exception => e + puts e + puts e.backtrace.join("\n") + raise e +end end if request.xhr? diff --git a/features/support/factory_girl.rb b/features/support/factory_girl.rb index 5efb5b9..87bf28b 100644 --- a/features/support/factory_girl.rb +++ b/features/support/factory_girl.rb @@ -111,6 +111,10 @@ def create_registration(user = TestState.my_account) 'group_ride' => true } registration.housing_data = { 'other' => '', 'companion' => false } + + registration.city_id = City.search('Los Angeles').id unless City.exists?(registration.city_id) + registration.data['city_id'] = City.search('Montreal').id unless City.exists?(registration.data['city_id']) + registration.save! if user == TestState.my_account diff --git a/features/support/location_cache.json b/features/support/location_cache.json index ec72f74..d0574eb 100644 --- a/features/support/location_cache.json +++ b/features/support/location_cache.json @@ -1 +1 @@ -{"Brooklyn NY":{"address_components":[{"long_name":"Brooklyn","short_name":"Brooklyn","types":["political","sublocality","sublocality_level_1"]},{"long_name":"Kings County","short_name":"Kings County","types":["administrative_area_level_2","political"]},{"long_name":"New York","short_name":"NY","types":["administrative_area_level_1","political"]},{"long_name":"United States","short_name":"US","types":["country","political"]}],"formatted_address":"Brooklyn, NY, USA","geometry":{"bounds":{"northeast":{"lat":40.739446,"lng":-73.8333651},"southwest":{"lat":40.551042,"lng":-74.05663}},"location":{"lat":40.6781784,"lng":-73.9441579},"location_type":"APPROXIMATE","viewport":{"northeast":{"lat":40.739446,"lng":-73.8333651},"southwest":{"lat":40.551042,"lng":-74.05663}}},"place_id":"ChIJCSF8lBZEwokRhngABHRcdoI","types":["political","sublocality","sublocality_level_1"]}} \ No newline at end of file +{"Brooklyn NY":{"address_components":[{"long_name":"Brooklyn","short_name":"Brooklyn","types":["political","sublocality","sublocality_level_1"]},{"long_name":"Kings County","short_name":"Kings County","types":["administrative_area_level_2","political"]},{"long_name":"New York","short_name":"NY","types":["administrative_area_level_1","political"]},{"long_name":"United States","short_name":"US","types":["country","political"]}],"formatted_address":"Brooklyn, NY, USA","geometry":{"bounds":{"northeast":{"lat":40.739446,"lng":-73.8333651},"southwest":{"lat":40.551042,"lng":-74.05663}},"location":{"lat":40.6781784,"lng":-73.9441579},"location_type":"APPROXIMATE","viewport":{"northeast":{"lat":40.739446,"lng":-73.8333651},"southwest":{"lat":40.551042,"lng":-74.05663}}},"place_id":"ChIJCSF8lBZEwokRhngABHRcdoI","types":["political","sublocality","sublocality_level_1"]},"Los Angeles":{"address_components":[{"long_name":"Los Angeles","short_name":"Los Angeles","types":["locality","political"]},{"long_name":"Los Angeles County","short_name":"Los Angeles County","types":["administrative_area_level_2","political"]},{"long_name":"California","short_name":"CA","types":["administrative_area_level_1","political"]},{"long_name":"United States","short_name":"US","types":["country","political"]}],"formatted_address":"Los Angeles, CA, USA","geometry":{"bounds":{"northeast":{"lat":34.3373061,"lng":-118.1552891},"southwest":{"lat":33.7036519,"lng":-118.6681759}},"location":{"lat":34.0522342,"lng":-118.2436849},"location_type":"APPROXIMATE","viewport":{"northeast":{"lat":34.3373061,"lng":-118.1552891},"southwest":{"lat":33.7036519,"lng":-118.6681759}}},"place_id":"ChIJE9on3F3HwoAR9AhGJW_fL-I","types":["locality","political"]},"Montreal":{"address_components":[{"long_name":"Montreal","short_name":"Montreal","types":["locality","political"]},{"long_name":"Montreal","short_name":"Montreal","types":["administrative_area_level_2","political"]},{"long_name":"Quebec","short_name":"QC","types":["administrative_area_level_1","political"]},{"long_name":"Canada","short_name":"CA","types":["country","political"]}],"formatted_address":"Montreal, QC, Canada","geometry":{"bounds":{"northeast":{"lat":45.7058381,"lng":-73.47426},"southwest":{"lat":45.410246,"lng":-73.986345}},"location":{"lat":45.5016889,"lng":-73.567256},"location_type":"APPROXIMATE","viewport":{"northeast":{"lat":45.7058381,"lng":-73.47426},"southwest":{"lat":45.410246,"lng":-73.986345}}},"place_id":"ChIJDbdkHFQayUwR7-8fITgxTmU","types":["locality","political"]}} \ No newline at end of file