Sha256: d4b30a0b98a1472e05affc5ea118e7e9941701686e2c3d910f577108a79001ff

Contents?: true

Size: 852 Bytes

Versions: 46

Compression:

Stored size: 852 Bytes

Contents

# This class exists to provide a test for including page behavior in controllers.
# I didn't know of a way to add functional tests for controllers/routes that aren't in
# the apps directory.
#
# This should be moved to the test directory if possible.
class Tests::PretendController < ApplicationController
  include Cms::Acts::ContentPage
  
  requires_permission_for_section "/members", :only=>[:restricted]

  RESTRICTED_H1 = "Restricted"

  def restricted
    render :text =>"<h1>#{RESTRICTED_H1}</h1> You can see this restricted page."
  end

  def open
    render :text =>"<h1>Open Page</h1> You can see this public page."   
  end

  def error
    raise StandardError     
  end

  def not_found
    raise ActiveRecord::RecordNotFound.new("This thing was missing!")
  end

  def open_with_layout
    render :layout=>"templates/subpage"
  end
end

Version data entries

46 entries across 46 versions & 6 rubygems

Version Path
browsercms-artirix-4.0.4 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.3.3 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.3.2 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.3.1 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.3 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.2 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.1.1 app/controllers/tests/pretend_controller.rb
browsercms-artirix-4.0.0.rc1.art4 app/controllers/tests/pretend_controller.rb
browsercms-4.0.0.rc1 app/controllers/tests/pretend_controller.rb
browsercms-4.0.0.beta app/controllers/tests/pretend_controller.rb
browsercms-4.0.0.alpha app/controllers/tests/pretend_controller.rb
browsercms-3.5.7 app/controllers/tests/pretend_controller.rb
browsercms-3.5.6 app/controllers/tests/pretend_controller.rb
browsercms-3.5.5 app/controllers/tests/pretend_controller.rb
browsercms-3.5.4 app/controllers/tests/pretend_controller.rb
browsercms-3.5.3 app/controllers/tests/pretend_controller.rb
browsercms-3.5.2 app/controllers/tests/pretend_controller.rb
browsercms-3.5.1 app/controllers/tests/pretend_controller.rb
browsercms-3.5.0 app/controllers/tests/pretend_controller.rb
browsercms-3.5.0.rc3 app/controllers/tests/pretend_controller.rb