Class: RedirectToWithBlockTest

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

Instance Method Summary collapse

Instance Method Details

#test_redirect_to_the_given_url_on_createObject



29
30
31
32
33
# File 'lib/vendor/plugins/inherited_resources/test/redirect_to_test.rb', line 29

def test_redirect_to_the_given_url_on_create
  Machine.stubs(:new).returns(mock_machine(:save => true))
  post :create
  assert_redirected_to 'http://test.host/create'
end

#test_redirect_to_the_given_url_on_destroyObject



41
42
43
44
45
# File 'lib/vendor/plugins/inherited_resources/test/redirect_to_test.rb', line 41

def test_redirect_to_the_given_url_on_destroy
  Machine.stubs(:find).returns(mock_machine(:destroy => true))
  delete :destroy
  assert_redirected_to 'http://test.host/destroy'
end

#test_redirect_to_the_given_url_on_updateObject



35
36
37
38
39
# File 'lib/vendor/plugins/inherited_resources/test/redirect_to_test.rb', line 35

def test_redirect_to_the_given_url_on_update
  Machine.stubs(:find).returns(mock_machine(:update_attributes => true))
  put :update
  assert_redirected_to 'http://test.host/update'
end