Sha256: e9f2b8f9fa192f5a3fc891347af8321ef77303895c69432736a84351103eae6f

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe "crumbs routing" do
  include ActionView::TestCase::Behavior

  context 'setting home breadcrumb' do
    it 'should inherit crumb for the root path' do
      visit root_path
      within '#breadcrumbs' do
        page.should have_content("Home")
      end
    end
  end

  context 'inheriting breadcrumbs setup' do
    it "should inherit root crumb for index action posts#index" do
      visit posts_path
      within '#breadcrumbs' do
        page.should have_content 'Home'
        page.should have_content 'All Posts'
        page.should_not have_content 'New Post'
      end
    end

    it 'should inherit and add new action specific breadcrumb' do
      visit new_post_path
      within '#breadcrumbs' do
        page.should have_content 'All Posts'
        page.should have_content 'New Post'
      end
    end
  end

  context 'adding breadcrumbs within view' do
    it 'should append view specified breadcrumb' do
      visit posts_path
      within '#breadcrumbs' do
        page.should have_content 'All Posts'
        page.should have_content 'View Post'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loaf-0.3.0 spec/integration/crumbs_routing_spec.rb
loaf-0.2.1 spec/integration/crumbs_routing_spec.rb