Sha256: 40ee31c16a4e512af2139ce57454d4a953e8f08c37a749c09c100cf89e4708c7
Contents?: true
Size: 1.78 KB
Versions: 1
Compression:
Stored size: 1.78 KB
Contents
require 'spec_helper' describe Outpost::Breadcrumb do it "has a title and a link" do breadcrumb = Outpost::Breadcrumb.new breadcrumb.should respond_to :title breadcrumb.should respond_to :link end end #------------------ describe Outpost::Breadcrumbs do describe "#breadcrumb" do context "ActionController::Base class" do let(:controller) { Outpost::PeopleController.new } it "has the breadcrumbs helper methods" do Outpost::PeopleController._helper_methods.should include :breadcrumbs end it "has both a title and link when both specified" do controller.breadcrumb "Title", "/some/path" controller.breadcrumbs.size.should eq 1 controller.breadcrumbs.first.title.should eq "Title" controller.breadcrumbs.first.link.should eq "/some/path" end it "only has a title when no link is specified" do controller.breadcrumb "Title" controller.breadcrumbs.size.should eq 1 controller.breadcrumbs.first.title.should eq "Title" controller.breadcrumbs.first.link.should eq nil end it "accepts multiple breadcrumbs" do controller.breadcrumb "Title", "/some/path", "Other", nil, "Page" controller.breadcrumbs.size.should eq 3 controller.breadcrumbs[0].title.should eq "Title" controller.breadcrumbs[0].link.should eq "/some/path" controller.breadcrumbs[1].title.should eq "Other" controller.breadcrumbs[1].link.should eq nil controller.breadcrumbs[2].title.should eq "Page" controller.breadcrumbs[2].link.should eq nil end end context "other class" do it "doesn't complain about helper_method" do class CoolGuy; include Outpost::Breadcrumbs; end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
outpost-cms-0.0.3 | spec/lib/breadcrumbs_spec.rb |