Class: DestroyActionCustomizedBaseTest
- Inherits:
-
ActionController::TestCase
- Object
- ActionController::TestCase
- DestroyActionCustomizedBaseTest
- Includes:
- CarTestHelper
- Defined in:
- lib/vendor/plugins/inherited_resources/test/customized_base_test.rb
Instance Method Summary collapse
- #test_show_flash_message_when_cannot_be_deleted ⇒ Object
- #test_show_flash_message_when_user_can_be_deleted ⇒ Object
- #test_the_requested_user_is_destroyed ⇒ Object
Methods included from CarTestHelper
Instance Method Details
#test_show_flash_message_when_cannot_be_deleted ⇒ Object
156 157 158 159 160 |
# File 'lib/vendor/plugins/inherited_resources/test/customized_base_test.rb', line 156 def Car.stubs(:get).returns(mock_car(:destroy_successfully => false)) delete :destroy assert_equal flash[:error], 'Car could not be destroyed.' end |
#test_show_flash_message_when_user_can_be_deleted ⇒ Object
150 151 152 153 154 |
# File 'lib/vendor/plugins/inherited_resources/test/customized_base_test.rb', line 150 def Car.stubs(:get).returns(mock_car(:destroy_successfully => true)) delete :destroy assert_equal flash[:notice], 'Car was successfully destroyed.' end |
#test_the_requested_user_is_destroyed ⇒ Object
143 144 145 146 147 148 |
# File 'lib/vendor/plugins/inherited_resources/test/customized_base_test.rb', line 143 def test_the_requested_user_is_destroyed Car.expects(:get).with('42').returns(mock_car) mock_car.expects(:destroy_successfully) delete :destroy, :id => '42' assert_equal mock_car, assigns(:car) end |