Class: OauthClientsControllerDestroyTest

Inherits:
ActionController::TestCase
  • Object
show all
Includes:
OAuthControllerTestHelper
Defined in:
lib/generators/test_unit/templates/clients_controller_test.rb

Instance Method Summary collapse

Instance Method Details

#do_deleteObject



215
216
217
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 215

def do_delete
  delete :destroy,:id=>'3'
end

#setupObject



206
207
208
209
210
211
212
213
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 206

def setup
  @controller = OauthClientsController.new
  @request    = ActionController::TestRequest.new
  @response   = ActionController::TestResponse.new

  
  @client_application.stubs(:destroy)
end

#test_should_destroy_client_applicationsObject



225
226
227
228
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 225

def test_should_destroy_client_applications
  @client_application.expects(:destroy)
  do_delete
end

#test_should_query_current_users_client_applicationsObject



219
220
221
222
223
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 219

def test_should_query_current_users_client_applications
  @user.expects(:client_applications).returns(@client_applications)
  @client_applications.expects(:find).with('3').returns(@client_application)
  do_delete
end

#test_should_redirect_to_listObject



230
231
232
233
234
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 230

def test_should_redirect_to_list
  do_delete
  assert_response :redirect
  assert_redirected_to :action => 'index'
end