Sha256: c2cf743befe982d3efb23c4db7c0b5e916d3a95ce5db41cf12363ede6274beb0

Contents?: true

Size: 403 Bytes

Versions: 6

Compression:

Stored size: 403 Bytes

Contents

require "test_helper"
require 'mocha'

class ProtectedController < ActionController::Base
  include Cms::Authentication::Controller
end

class ControllerTest < ActiveSupport::TestCase

  test "Sets current user in thread local" do
    u = Cms::User.new()

    c = ProtectedController.new
    c.expects(:session).returns({})

    c.send(:current_user=, u)

    assert_equal u, Cms::User.current
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
browsercms-3.4.2 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.4.2.rc1 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.4.1 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.4.0 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.4.0.rc2 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.4.0.rc1 test/unit/lib/cms/authentication/controller_test.rb