Sha256: cadc0a675e1f0abbff9e4a3c2bac511b04faf19535b454178b687fa6e736d8b5

Contents?: true

Size: 1.91 KB

Versions: 4

Compression:

Stored size: 1.91 KB

Contents

require File.expand_path('../test_helper', __FILE__)

require 'authpwn_rails/generators/templates/session_controller.rb'

# Tests the routes created by authpwn_session.
class RoutesTest < ActionController::TestCase
  tests SessionController

  test 'authpwn_session routes' do
    assert_routing({path: '/session', method: :get},
                   {controller: 'session', action: 'show'})
    assert_routing({path: '/session/new', method: :get},
                   {controller: 'session', action: 'new'})
    assert_routing({path: '/session', method: :post},
                   {controller: 'session', action: 'create'})
    assert_routing({path: '/session', method: :delete},
                   {controller: 'session', action: 'destroy'})
    assert_routing({path: '/session', method: :delete},
                   {controller: 'session', action: 'destroy'})
    assert_routing({path: '/session/change_password', method: :get},
                   {controller: 'session', action: 'password_change'})
    assert_routing({path: '/session/change_password', method: :post},
                   {controller: 'session', action: 'change_password'})
    assert_routing({path: '/session/reset_password', method: :post},
                   {controller: 'session', action: 'reset_password'})

    code = 'YZ-Fo8HX6_NyU6lVZXYi6cMDLV5eAgt35UTF5l8bD6A'
    assert_routing({path: "/session/token/#{code}", method: :get},
        {controller: 'session', action: 'token', code: code})

    assert_routing({path: '/auth/failure', method: :get},
                   {controller: 'session', action: 'omniauth_failure'})
    assert_routing({path: '/auth/twitter/callback', method: :get},
                   {controller: 'session', action: 'omniauth',
                    provider: 'twitter'})
    assert_routing({path: '/auth/twitter/callback', method: :post},
                   {controller: 'session', action: 'omniauth',
                    provider: 'twitter'})
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authpwn_rails-0.18.0 test/routes_test.rb
authpwn_rails-0.17.2 test/routes_test.rb
authpwn_rails-0.17.1 test/routes_test.rb
authpwn_rails-0.17.0 test/routes_test.rb