Sha256: 3aa987826b97172df387132fc15203cab5db1bd3d97bfef6e28588ef89bc66ee

Contents?: true

Size: 1.53 KB

Versions: 14

Compression:

Stored size: 1.53 KB

Contents

require 'test_helper'

class AuthenticationsControllerTest < ActionController::TestCase
  setup do
    login(users(:valid))
    @request.env["omniauth.auth"] = {'provider' => 'google_apps', 'user_info'=> {'email' => 'test@example.com'}}
    @authentication = authentications(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:authentications)
  end

  # TODO: Remove
  # test "should get new" do
  #   get :new
  #   assert_response :success
  # end

  # TODO Redirects to Authentication Controller if user logged in, if not redirect to user sign up.
  test "should create authentication" do
    assert_difference('Authentication.count') do
      post :create, :authentication => @authentication.attributes
    end

    assert_redirected_to authentications_path
  end

  # TODO: Remove
  # test "should show authentication" do
  #   get :show, :id => @authentication.to_param
  #   assert_response :success
  # end

  # TODO: Remove
  # test "should get edit" do
  #   get :edit, :id => @authentication.to_param
  #   assert_response :success
  # end

  # TODO: Remove
  # test "should update authentication" do
  #   put :update, :id => @authentication.to_param, :authentication => @authentication.attributes
  #   assert_redirected_to authentication_path(assigns(:authentication))
  # end

  test "should destroy authentication" do
    assert_difference('Authentication.count', -1) do
      delete :destroy, :id => @authentication.to_param
    end

    assert_redirected_to authentications_path
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
contour-0.6.1 test/functional/authentications_controller_test.rb
contour-0.6.0 test/functional/authentications_controller_test.rb
contour-0.5.7 test/functional/authentications_controller_test.rb
contour-0.5.6 test/functional/authentications_controller_test.rb
contour-0.5.5 test/functional/authentications_controller_test.rb
contour-0.5.4 test/functional/authentications_controller_test.rb
contour-0.5.3 test/functional/authentications_controller_test.rb
contour-0.5.2 test/functional/authentications_controller_test.rb
contour-0.5.1 test/functional/authentications_controller_test.rb
contour-0.5.0 test/functional/authentications_controller_test.rb
contour-0.4.0 test/functional/authentications_controller_test.rb
contour-0.3.2 test/functional/authentications_controller_test.rb
contour-0.3.1 test/functional/authentications_controller_test.rb
contour-0.3.0 test/functional/authentications_controller_test.rb