Sha256: 183df6740495e0161dd20bda9de1bc96877edf355c2f26ca753630c607857b5b

Contents?: true

Size: 814 Bytes

Versions: 7

Compression:

Stored size: 814 Bytes

Contents

require 'test_helper'

module Spina
  module Admin
    class LoginTest < ActionDispatch::IntegrationTest
      setup do
        @routes = Engine.routes
      end

      test "login and browse pages" do
        get "/admin/login"
        assert_response :success

        post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "password"
        assert_equal '/admin', path

        get "/admin/pages"
        assert_response :success
        assert assigns(:pages)
      end

      test "login with wrong password" do
        get "/admin/login"
        assert_response :success
        post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "wrongpassword"
        assert_equal '/admin/sessions', path
        assert_nil assigns(:pages)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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