Class: OauthClientsControllerEditTest

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_getObject



129
130
131
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 129

def do_get
  get :edit, :id=>'3'
end

#setupObject



121
122
123
124
125
126
127
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 121

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

  
end

#test_should_assign_client_applicationsObject



144
145
146
147
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 144

def test_should_assign_client_applications
  do_get
  assert_equal @client_application, assigns(:client_application)
end

#test_should_be_successfulObject



133
134
135
136
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 133

def test_should_be_successful
  do_get
  assert @response.success?
end

#test_should_query_current_users_client_applicationsObject



138
139
140
141
142
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 138

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_get
end

#test_should_render_edit_templateObject



149
150
151
152
# File 'lib/generators/test_unit/templates/clients_controller_test.rb', line 149

def test_should_render_edit_template
  do_get
  assert_template 'edit'
end