Sha256: 2af2e2e8b5d493caecd2a2a8c30bec0984a30cef9f06d2e92e359cb9526b4fae

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

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

class ViewHooksTest < ActionDispatch::IntegrationTest
  
  def test_hooks_rendering
    CmsAdmin::SitesController.append_view_path(File.expand_path('../fixtures/views', File.dirname(__FILE__)))
    LucyCMS::ViewHooks.add(:navigation, '/nav_hook')
    
    http_auth :get, cms_admin_sites_path
    assert_response :success
    assert_match /hook_content/, response.body
  end
  
  def test_hooks_rendering_with_multiples
    CmsAdmin::SitesController.append_view_path(File.expand_path('../fixtures/views', File.dirname(__FILE__)))
    LucyCMS::ViewHooks.add(:navigation, '/nav_hook')
    LucyCMS::ViewHooks.add(:navigation, '/nav_hook_2')
    
    http_auth :get, cms_admin_sites_path
    assert_response :success
    assert_match /hook_content/, response.body
    assert_match /<hook_content_2>/, response.body
  end
  
  def test_hooks_rendering_with_no_hook
    LucyCMS::ViewHooks.remove(:navigation)
    
    http_auth :get, cms_admin_sites_path
    assert_response :success
    assert_no_match /hook_content/, response.body
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lucy_cms-0.0.6 test/integration/view_hooks_test.rb
lucy_cms-0.0.5 test/integration/view_hooks_test.rb
lucy_cms-0.0.4 test/integration/view_hooks_test.rb
lucy_cms-0.0.3 test/integration/view_hooks_test.rb
lucy_cms-0.0.2 test/integration/view_hooks_test.rb
lucy_cms-0.0.1 test/integration/view_hooks_test.rb