Sha256: be72317f584ce67662226108a9e94858c100e7d8ffdfe373252c8468ebd73327

Contents?: true

Size: 1.4 KB

Versions: 23

Compression:

Stored size: 1.4 KB

Contents

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

class RenderCmsTest < ActionDispatch::IntegrationTest
  
  def setup
    Rails.application.routes.draw do
      get '/render-implicit'  => 'render_test#implicit'
      get '/render-explicit'  => 'render_test#explicit'
      get '/seed_data_page'   => 'render_test#seed_data_page'
    end
    super
  end
  
  def teardown
    load(File.expand_path('config/routes.rb', Rails.root))
  end
  
  class ::RenderTestController < ApplicationController
    def implicit
      render
    end
    def explicit
      render :cms_page => '/render-explicit-page'
    end
    def seed_data_page
      render :cms_page => '/'
    end
  end
  
  def test_get_with_no_template
    assert_exception_raised ActionView::MissingTemplate do
      get '/render-implicit'
    end
  end
  
  def test_get_with_implicit_cms_template
    page = cms_pages(:child)
    page.slug = 'render-implicit'
    page.save!
    get '/render-implicit'
    assert_response :success
  end
  
  def test_get_with_explicit_cms_template
    page = cms_pages(:child)
    page.slug = 'render-explicit-page'
    page.save!
    get '/render-explicit'
    assert_response :success
  end
  
  def test_get_with_explicit_cms_template_failure
    page = cms_pages(:child)
    page.slug = 'render-explicit-404'
    page.save!
    assert_exception_raised ActionView::MissingTemplate do
      get '/render-explicit'
    end
  end
  
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.0.36 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.35 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.34 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.33 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.32 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.31 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.30 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.29 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.28 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.27 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.26 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.25 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.24 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.23 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.22 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.21 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.20 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.19 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.18 test/integration/render_cms_test.rb
comfortable_mexican_sofa-1.0.17 test/integration/render_cms_test.rb