Sha256: 3774186d2729bde33811b61945be857acf9e852ad0cd79db5fea70c168a605b0

Contents?: true

Size: 814 Bytes

Versions: 7

Compression:

Stored size: 814 Bytes

Contents

require 'test_helper'

module Spina
  module Admin
    class SessionsControllerTest < ActionController::TestCase
      setup do
        @routes = ::Spina::Engine.routes
      end

      test "login renders the correct layout" do
        get :new
        assert_template layout: 'spina/login'
      end

      test "should be able to login" do
        post :create, email: spina_users(:bram).email, password: "password"
        assert_not_nil session[:user_id]
      end

      test "should be able to logout" do
        get :destroy
        assert_nil session[:user_id]
      end

      test "should alert the user when wrong password" do
        post :create, email: spina_users(:bram).email, password: "1234"
        assert_nil session[:user_id]
        assert_not_empty flash[:alert]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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