class OauthClientsControllerUpdateTest

Public Instance Methods

do_invalid_update() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 254
def do_invalid_update
  @client_application.expects(:update_attributes).returns(false)
  put :update, :id=>'1', 'client_application' => {'name'=>'my site'}
end
do_valid_update() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 249
def do_valid_update
  @client_application.expects(:update_attributes).returns(true)
  put :update, :id => '1', 'client_application' => {'name'=>'my site'}
end
setup() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 242
def setup
  @controller = OauthClientsController.new
  @request    = ActionController::TestRequest.new
  @response   = ActionController::TestResponse.new
  login_as_application_owner
end
test_should_assign_client_applications() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 271
def test_should_assign_client_applications
  do_invalid_update
  assert_equal @client_application, assigns(:client_application)
end
test_should_query_current_users_client_applications() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 259
def test_should_query_current_users_client_applications
  @user.expects(:client_applications).returns(@client_applications)
  @client_applications.expects(:find).with('1').returns(@client_application)
  do_valid_update
end
test_should_redirect_to_new_client_application() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 265
def test_should_redirect_to_new_client_application
  do_valid_update
  assert_response :redirect
  assert_redirected_to :action => "show", :id => @client_application.id
end
test_should_render_show_template() click to toggle source
# File lib/generators/test_unit/templates/clients_controller_test.rb, line 276
def test_should_render_show_template
  do_invalid_update
  assert_template('edit')
end