summaryrefslogtreecommitdiff
path: root/spec/helpers/wiki_helper_spec.rb
blob: d3922c3d2f67ab13cad5593417dfa2a1a01e9c45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require "spec_helper"

describe WikiHelper do
  describe "#breadcrumb" do
    context "when the page is at the root level" do
      it "returns the capitalized page name" do
        slug = "page-name"

        expect(helper.breadcrumb(slug)).to eq("Page name")
      end
    end

    context "when the page is inside a directory" do
      it "returns the capitalized name of each directory and of the page itself" do
        slug = "dir_1/page-name"

        expect(helper.breadcrumb(slug)).to eq("Dir_1 / Page name")
      end
    end
  end
end