Class: ShowActionBaseTest
- Inherits:
-
ActionController::TestCase
- Object
- ActionController::TestCase
- ShowActionBaseTest
- Includes:
- UserTestHelper
- Defined in:
- lib/vendor/plugins/inherited_resources/test/base_test.rb
Instance Method Summary collapse
- #test_controller_should_render_show ⇒ Object
- #test_expose_the_resquested_user ⇒ Object
- #test_render_exposed_user_as_xml_when_mime_type_is_xml ⇒ Object
Methods included from UserTestHelper
Instance Method Details
#test_controller_should_render_show ⇒ Object
62 63 64 65 66 67 |
# File 'lib/vendor/plugins/inherited_resources/test/base_test.rb', line 62 def test_controller_should_render_show User.stubs(:find).returns(mock_user) get :show assert_response :success assert_equal 'Show HTML', @response.body.strip end |
#test_expose_the_resquested_user ⇒ Object
56 57 58 59 60 |
# File 'lib/vendor/plugins/inherited_resources/test/base_test.rb', line 56 def test_expose_the_resquested_user User.expects(:find).with('42').returns(mock_user) get :show, :id => '42' assert_equal mock_user, assigns(:user) end |
#test_render_exposed_user_as_xml_when_mime_type_is_xml ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/vendor/plugins/inherited_resources/test/base_test.rb', line 69 def test_render_exposed_user_as_xml_when_mime_type_is_xml @request.accept = 'application/xml' User.expects(:find).with('42').returns(mock_user) mock_user.expects(:to_xml).returns("Generated XML") get :show, :id => '42' assert_response :success assert_equal 'Generated XML', @response.body end |