Sha256: ea10f883c220a69ce1b64bab51c3187df99ce4ef3d99eea258abb0377423f47f

Contents?: true

Size: 902 Bytes

Versions: 33

Compression:

Stored size: 902 Bytes

Contents

require 'test_helper'

class BreadrumbsHelperTest < ActionView::TestCase
  include Adminpanel::BreadcrumbsHelper
  include Rails.application.routes.url_helpers

  fixtures :all

  setup :setup
  teardown :teardown

  def setup
    breadcrumb_add('controller', 'http://controller.com')
    breadcrumb_add('action', 'http://action.com')
  end

  def teardown
    @breadcrumb = :nil
  end

  def test_breadcrumb_add
    assert_equal( { title: I18n.t('breadcrumb.index'), url: adminpanel.root_url }, @breadcrumb.first)
    assert_equal( { title: 'controller', url: 'http://controller.com' }, @breadcrumb.second)
    assert_equal( { title: 'action', url: 'http://action.com' }, @breadcrumb.third)
  end

  def test_render_breadcrumb
    assert_equal(
      render_breadcrumb('divider'),
      render(partial: 'adminpanel/shared/breadcrumb', locals: { nav: @breadcrumb, divider: 'divider' })
    )
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
adminpanel-3.6.1 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.6.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.5.1 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.5.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.7 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.6 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.5 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.4 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.3 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.2 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.1 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.4.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.3.4 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.3.3 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.3.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.2.1 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.2.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.1.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-3.0.0 test/helpers/breadcrumbs_helper_test.rb
adminpanel-2.6.1 test/helpers/breadcrumbs_helper_test.rb