Sha256: 66d4464fe36fd705f328a8f92f68f330425f58cedfaa36ef2d2e2b563a9bfcb1

Contents?: true

Size: 888 Bytes

Versions: 1

Compression:

Stored size: 888 Bytes

Contents

require 'spec_helper'
module Axel
  describe ApplicationHelper do
    before do
      helper.stub drop_meta?: false
    end
    describe "page title" do
      it "is empty with no title locales implemented" do
        helper.page_title.should == ""
      end

      context "with locale hash" do
        let(:action_param) { "show" }
        let(:controller_param) { "pages" }
        let(:params) { { action: action_param, controller: controller_param } }
        let(:t) { { user: { pages: { show: "User Page Show" } }, pages: { show: "Page Show" } } }

        before do
          helper.stub t: t, params: params
        end

        it { helper.page_title.should == " - Page Show" }

        context "nested controller name" do
          let(:controller_param) { "user/pages" }
          it { helper.page_title.should == " - User Page Show" }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axel-0.0.1 spec/helpers/axel/application_helper_spec.rb