Sha256: 04589a1b8d2c109e85b749f1af8e7aa8f43b9ca12a2cd91228dff2ee24cf21d9

Contents?: true

Size: 824 Bytes

Versions: 7

Compression:

Stored size: 824 Bytes

Contents

require 'test_helper'

module Spina
  module Admin
    class AdminControllerTest < ActionController::TestCase
      setup do
        class ::TestingController < AdminController
          def hello
            render :nothing => true
          end
        end

        @routes = ::Spina::Engine.routes

        ActionController::Routing::Routes.draw do |map|
          map.hello '', :controller => 'testing', :action => 'hello'
        end
      end

      teardown do
        Object.send(:remove_const, :TestingController)
      end

      context 'when user is not logged in' do
        setup do
          @controller = TestingController.new
        end

        test "redirect unauthorized users to login page" do
          get :hello
          assert_template layout: 'spina/login'
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spina-0.8.3 test/functional/spina/admin/admin_controller.rb
spina-0.8.2 test/functional/spina/admin/admin_controller.rb
spina-0.8.1 test/functional/spina/admin/admin_controller.rb
spina-0.8.0 test/functional/spina/admin/admin_controller.rb
spina-0.7.3 test/functional/spina/admin/admin_controller.rb
spina-0.7.2 test/functional/spina/admin/admin_controller.rb
spina-0.7.0 test/functional/spina/admin/admin_controller.rb