Sha256: 19b2015f5c30946495deaa621adc7f1a6693783d6b46827d44c005d080e0bbcf

Contents?: true

Size: 601 Bytes

Versions: 5

Compression:

Stored size: 601 Bytes

Contents

# encoding: utf-8

RSpec.describe Loaf::ViewExtensions, '.breadcrumb' do

  it { expect(DummyView.new).to respond_to(:add_breadcrumb) }

  it 'creates crumb instance' do
    instance = DummyView.new
    name = 'Home'
    url  = :home_path
    allow(Loaf::Crumb).to receive(:new).with(name, url, {})
    instance.breadcrumb name, url
    expect(Loaf::Crumb).to have_received(:new).with(name, url, {})
  end

  it 'adds crumb to breadcrumbs storage' do
    instance = DummyView.new
    expect {
      instance.breadcrumb 'Home', :home_path
    }.to change { instance._breadcrumbs.size }.by(1)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
loaf-0.8.1 spec/unit/view_extensions/breadcrumb_spec.rb
loaf-0.8.0 spec/unit/view_extensions/breadcrumb_spec.rb
loaf-0.7.0 spec/unit/view_extensions/breadcrumb_spec.rb
loaf-0.6.2 spec/unit/view_extensions/breadcrumb_spec.rb
loaf-0.6.1 spec/unit/view_extensions/breadcrumb_spec.rb