Sha256: caae8e338d9c6fcbd0a060bea65d61018add83ce8cbdae7923cab8d1f4121671

Contents?: true

Size: 660 Bytes

Versions: 11

Compression:

Stored size: 660 Bytes

Contents

require 'spec_helper'

describe SimpleAdmin::Breadcrumbs do
  it "parses the path" do
    SimpleAdmin::Breadcrumbs.parse("/admin/things", "index").should == [["Admin", "/admin"]]
  end

  it "includes the last step if creating" do
    SimpleAdmin::Breadcrumbs.parse("/admin/things", "create").should == [["Admin", "/admin"], ["Things", "/admin/things"]]
  end

  it "finds the object and uses the display name" do
    @thing = Factory(:thing)
    Thing.any_instance.expects(:display_name).returns("A Thing!")
    SimpleAdmin::Breadcrumbs.parse("/things/#{@thing.id}", "create").should == [["Things", "/things"],["A Thing!", "/things/#{@thing.id}"]]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
simple_admin-0.7.1 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.6.0 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.5.2 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.5.1 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.5.0 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.4.1 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.4.0 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.3.1 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.3.0 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.2.1 spec/simple_admin/breadcrumbs_spec.rb
simple_admin-0.1.0 spec/simple_admin/breadcrumbs_spec.rb