Skip to content

Commit

Permalink
Fix failing tests after moving to latest Rails.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 7, 2011
1 parent 7245836 commit a6e2477
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ GEM
multi_json (~> 1.0)
arel (2.2.1)
builder (3.0.0)
columnize (0.3.5)
erubis (2.7.0)
has_scope (0.5.1)
hike (1.2.1)
i18n (0.6.0)
json (1.6.3)
linecache (0.46)
rbx-require-relative (> 0.0.4)
mail (2.3.0)
i18n (>= 0.4.0)
mime-types (~> 1.16)
Expand Down Expand Up @@ -71,9 +74,15 @@ GEM
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rbx-require-relative (0.0.5)
rdoc (3.11)
json (~> 1.4)
responders (0.6.4)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
ruby-debug-base (0.10.4)
linecache (>= 0.3)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
Expand All @@ -93,3 +102,4 @@ DEPENDENCIES
mocha
rails (= 3.1.2)
responders (~> 0.6.0)
ruby-debug
8 changes: 4 additions & 4 deletions test/nested_model_with_shallow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ def test_assigns_subfaculty_and_speciality_and_group_on_edit

def test_expose_a_newly_create_group_with_speciality
Speciality.expects(:find).with('37').twice.returns(mock_speciality)
Plan::Group.expects(:build).with({'these' => :params}).returns(mock_group(:save => true))
post :create, :speciality_id => '37', :group => {:these => :params}
Plan::Group.expects(:build).with({'these' => 'params'}).returns(mock_group(:save => true))
post :create, :speciality_id => '37', :group => {'these' => 'params'}
assert_equal mock_group, assigns(:group)
end

def test_expose_a_update_group_with_speciality
should_find_parents
mock_group.expects(:update_attributes).with('these' => :params).returns(true)
post :update, :id => 'forty_two', :group => {:these => :params}
mock_group.expects(:update_attributes).with('these' => 'params').returns(true)
post :update, :id => 'forty_two', :group => {'these' => 'params'}
assert_equal mock_group, assigns(:group)
end

Expand Down
3 changes: 1 addition & 2 deletions test/url_helpers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ class ImageButtonsController < ButtonsController
# Create a TestHelper module with some helpers
class UrlHelpersTest < ActiveSupport::TestCase
def mock_polymorphic(controller, route)
controller.expects(:url_for).with(:no=>"no")
controller._routes.url_helpers.expects("hash_for_#{route}").returns({:no=>"no"})
controller.expects(route)
end

def test_url_helpers_on_simple_inherited_resource
Expand Down

0 comments on commit a6e2477

Please sign in to comment.