Sha256: d455a87606f96351eac51a3ff0f69a4fcdde68d7b4a4d6160fc65d88fb435d9b

Contents?: true

Size: 393 Bytes

Versions: 11

Compression:

Stored size: 393 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 = User.new()

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

    c.send(:current_user=, u)

    assert_equal u, User.current
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
browsercms-3.1.5 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.1.4 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.1.3 test/unit/lib/cms/authentication/controller_test.rb
drujensen-browsercms-3.2.0 test/unit/lib/cms/authentication/controller_test.rb
browsercmsi-3.1.2 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.1.2 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.1.1 test/unit/lib/cms/authentication/controller_test.rb
browsercmsi-3.1.1 test/unit/lib/cms/authentication/controller_test.rb
browsercmsi-3.1.0 test/unit/lib/cms/authentication/controller_test.rb
browsercms-3.1.0 test/unit/lib/cms/authentication/controller_test.rb
we5-browsercms-3.1.0 test/unit/lib/cms/authentication/controller_test.rb