Sha256: c765029df0f45b9e79319cfc5697c70d250ba4aaa03185de41c670323eaeddaa

Contents?: true

Size: 1.14 KB

Versions: 92

Compression:

Stored size: 1.14 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__)))
    ComfortableMexicanSofa::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__)))
    ComfortableMexicanSofa::ViewHooks.add(:navigation, '/nav_hook')
    ComfortableMexicanSofa::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
    ComfortableMexicanSofa::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

92 entries across 92 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.24 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.23 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.22 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.21 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.20 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.19 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.18 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.17 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.16 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.15 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.14 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.13 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.12 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.11 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.10 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.9 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.8 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.7 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.6 test/integration/view_hooks_test.rb
comfortable_mexican_sofa-1.6.5 test/integration/view_hooks_test.rb