Created
April 18, 2012 18:10
-
-
Save kenton/2415507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables set in the controller's setup method: | |
@pickup_coords = "37.7970456263422,-122.395925521724" | |
@valid_dropoff_coords = "37.7835680142054,-122.469833645424" | |
@out_of_range_dropoff_coords = "35.5,-119.5" | |
# the controller test... | |
test "returns an empty price and the correct response code when user requests dropoff location too far from center of OndemandMarket" do | |
post :update, {:pickup_coords => @pickup_coords, :dropoff_coords => @out_of_range_dropoff_coords } | |
assert_response :success | |
assert_equal "", assigns(:price).to_s | |
assert_equal "405", assigns(:response_code) | |
assert_not_nil assigns(:error_message) | |
end | |
# error | |
test_returns_an_empty_price_and_the_correct_response_code_when_user_requests_dropoff_location_too_far_from_center_of_OndemandMarket(Ondemand::RateCardsControllerTest): | |
NoMethodError: undefined method `center_latlng' for nil:NilClass | |
lib/ondemand/pricing/geographic_shapes/market_lookup.rb:19:in `within_dropoff_range?' | |
lib/ondemand/pricing/ride/quote_ride.rb:28:in `new_from_rate_card' | |
app/controllers/ondemand/rate_cards_controller.rb:64:in `update' | |
test/functional/ondemand/rate_cards_controller_test.rb:74:in `test_returns_an_empty_price_and_the_correct_response_code_when_user_requests_dropoff_location_too_far_from_center_of_OndemandMarket' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment