Sha256: be05d01eab4c04ed1cefe1d58f640505eb572f4f0e033cd0b8ba3a74734d0796

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'comatose_controller'
require 'comatose_helper'

# Re-raise errors caught by the controller.
class ComatoseController
  def rescue_action(e) raise e end
end


class ComatoseControllerTest < Test::Unit::TestCase

  fixtures :comatose_pages

  def setup
    @controller = ComatoseController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  
  def test_truth
    assert true
  end
  
  should "show pages based on path_info" do

    # Get the faq page...
    get :show, :page=>'faq', :index=>'', :layout=>'base.html.erb', :use_cache=>'false'
    assert_response :success
    assert_tag :tag=>'h1', :child=>/Frequently Asked Questions/

    # Get a question page using rails 2.0 array style...
    get :show, :page=>['faq','question-one'], :index=>'', :layout=>'base.html.erb', :use_cache=>'false'
    assert_response :success
    assert_tag :tag=>'title', :child=>/Question/

    # Get a question page using rails 1.x path style...
    get :show, :page=>ActionController::Routing::PathSegment::Result.new_escaped(['faq','question-one']), 
        :index=>'', :layout=>'base.html.erb', :use_cache=>'false'
    assert_response :success
    assert_tag :tag=>'title', :child=>/Question/
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
comatose-rubyisbeautiful-3.0.5 test/functional/comatose_controller_test.rb
comatose-rubyisbeautiful-3.0.4 test/functional/comatose_controller_test.rb
comatose-rubyisbeautiful-3.0.3 test/functional/comatose_controller_test.rb
comatose-rubyisbeautiful-3.0.2 test/functional/comatose_controller_test.rb
comatose-rubyisbeautiful-3.0.1 test/functional/comatose_controller_test.rb
comatose-rubyisbeautiful-3.0.0 test/functional/comatose_controller_test.rb