Sha256: 17ddb68c292c7ac4e6e8cec1db91fb13bb459e2092d48ee236828e8443cbfbc1

Contents?: true

Size: 1.23 KB

Versions: 16

Compression:

Stored size: 1.23 KB

Contents

require File.join(File.dirname(__FILE__), '/../../test_helper')

class Cms::SessionsControllerTest < ActionController::TestCase
  include Cms::ControllerTestHelper
  
  def test_not_redirected_to_cms_site_if_public_site
    @request.host = "foo.com"
    @request.request_uri = "/cms/login"
    get :new
    assert_response :success
  end

  def test_not_redirected_if_cms_site
    @request.host = "cms.foo.com"
    @request.request_uri = "/cms/login"
    get :new
    assert_response :success
    log @response.body
    assert_select "title", "CMS Login"
  end
  
end

class Cms::SessionsControllerCacheEnabledTest < ActionController::TestCase
  include Cms::ControllerTestHelper
  tests Cms::SessionsController
  
  def setup
    @controller.perform_caching = true
  end
  
  def teardown
    @controller.perform_caching = false
  end
  
  def test_redirected_to_cms_site_if_public_site
    @request.host = "foo.com"
    @request.request_uri = "/cms/login"
    get :new
    assert_redirected_to "http://cms.foo.com/cms/login"
  end

  def test_not_redirected_if_cms_site
    @request.host = "cms.foo.com"
    @request.request_uri = "/cms/login"
    get :new
    assert_response :success
    log @response.body
    assert_select "title", "CMS Login"
  end
  
end

Version data entries

16 entries across 16 versions & 8 rubygems

Version Path
SFEley-browsercms-3.0.2 test/functional/cms/sessions_controller_test.rb
buzzware-browsercms-3.0.2 test/functional/cms/sessions_controller_test.rb
coredumplings-browsercms-3.0.0 test/functional/cms/sessions_controller_test.rb
nate-browsercms-3.0.210 test/functional/cms/sessions_controller_test.rb
nate-browsercms-3.0.211 test/functional/cms/sessions_controller_test.rb
we5-browsercms-3.0.1.1 test/functional/cms/sessions_controller_test.rb
webficient-browsercms-3.0.1 test/functional/cms/sessions_controller_test.rb
webficient-browsercms-3.0.2 test/functional/cms/sessions_controller_test.rb
webficient-browsercms-3.0.3 test/functional/cms/sessions_controller_test.rb
webficient-browsercms-3.0.4 test/functional/cms/sessions_controller_test.rb
browsercms_s3-3.0.4 test/functional/cms/sessions_controller_test.rb
browsercms_s3-3.0.3 test/functional/cms/sessions_controller_test.rb
we5-browsercms-3.0.2 test/functional/cms/sessions_controller_test.rb
browsercms-3.0.2 test/functional/cms/sessions_controller_test.rb
browsercms-3.0.1 test/functional/cms/sessions_controller_test.rb
browsercms-3.0.0 test/functional/cms/sessions_controller_test.rb