Class: EditActionBaseTest

Inherits:
ActionController::TestCase
  • Object
show all
Includes:
UserTestHelper
Defined in:
lib/vendor/plugins/inherited_resources/test/base_test.rb

Instance Method Summary collapse

Methods included from UserTestHelper

#setup

Instance Method Details

#test_controller_should_render_editObject



115
116
117
118
119
120
# File 'lib/vendor/plugins/inherited_resources/test/base_test.rb', line 115

def test_controller_should_render_edit
  User.stubs(:find).returns(mock_user)
  get :edit
  assert_response :success
  assert_equal 'Edit HTML', @response.body.strip
end

#test_expose_the_resquested_userObject



108
109
110
111
112
113
# File 'lib/vendor/plugins/inherited_resources/test/base_test.rb', line 108

def test_expose_the_resquested_user
  User.expects(:find).with('42').returns(mock_user)
  get :edit, :id => '42'
  assert_response :success
  assert_equal mock_user, assigns(:user)
end