Browse Source

Fixed failing tests

development
Godwin 7 years ago
parent
commit
a54546976d
  1. 7
      app/controllers/conferences_controller.rb
  2. 4
      features/support/factory_girl.rb
  3. 2
      features/support/location_cache.json

7
app/controllers/conferences_controller.rb

@ -78,7 +78,7 @@ class ConferencesController < ApplicationController
return redirect_to pp_response.redirect_uri return redirect_to pp_response.redirect_uri
end end
end end
begin
# get the current step # get the current step
@step = current_registration_step(@this_conference, current_user) @step = current_registration_step(@this_conference, current_user)
@ -97,6 +97,11 @@ class ConferencesController < ApplicationController
result = registration_step(@step, @this_conference, current_user) result = registration_step(@step, @this_conference, current_user)
# pass any data on to the view # pass any data on to the view
data_to_instance_variables(result) data_to_instance_variables(result)
rescue Exception => e
puts e
puts e.backtrace.join("\n")
raise e
end
end end
if request.xhr? if request.xhr?

4
features/support/factory_girl.rb

@ -111,6 +111,10 @@ def create_registration(user = TestState.my_account)
'group_ride' => true 'group_ride' => true
} }
registration.housing_data = { 'other' => '', 'companion' => false } 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! registration.save!
if user == TestState.my_account if user == TestState.my_account

2
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"]}} {"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"]}}
Loading…
Cancel
Save