Skip to content

Commit

Permalink
fixed location_controller_test mocks to expect favorite location [] n…
Browse files Browse the repository at this point in the history
…ow being passed by Locatable
  • Loading branch information
jamesarosen committed Jun 26, 2008
1 parent 7a6e10c commit b95d253
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/location_controller_test.rb
Expand Up @@ -43,7 +43,7 @@ class LocationControllerTest < ActionController::TestCase

should 'be able to change her location' do
@houston = locations(:houston_tx)
Location.expects(:parse).with('anywhere').returns(@houston)
Location.expects(:parse).with('anywhere', current_profile.favorite_locations).returns(@houston)

post :update, :profile_id => current_user, :location => 'anywhere'
assert_response :redirect
Expand All @@ -53,7 +53,7 @@ class LocationControllerTest < ActionController::TestCase

should 'not be able to change her location to an unparseable string' do
old_location = current_user.profile.location
Location.expects(:parse).with('anywhere').raises(Location::ParseError.new('foo'))
Location.expects(:parse).with('anywhere', current_profile.favorite_locations).raises(Location::ParseError.new('foo'))
post :update, :profile_id => current_user, :location => 'anywhere'
assert_template 'location/edit'
assert_equal old_location, current_user.profile.location
Expand Down

0 comments on commit b95d253

Please sign in to comment.