Sha256: e574d3afcce2d5acefdbdc6aaf7529f418b69cb1cc7f56f368c440ebceac26e8

Contents?: true

Size: 797 Bytes

Versions: 3

Compression:

Stored size: 797 Bytes

Contents

require "spec_helper"

describe "Refinery::ApplicationController" do
  describe "DummyController", :type => :controller do
    controller do
      include ::Refinery::ApplicationController
    end

    describe ".home_page?" do
      it "matches root url" do
        controller.stub(:root_path).and_return("/")
        request.stub(:path).and_return("/")
        controller.home_page?.should be_true
      end

      it "matches localised root url" do
        controller.refinery.stub(:root_path).and_return("/en/")
        request.stub(:path).and_return("/en")
        controller.home_page?.should be_true
      end

      it "escapes regexp" do
        request.stub(:path).and_return("\/huh)")
        expect { controller.home_page? }.to_not raise_error(RegexpError)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-core-2.0.2 spec/lib/refinery/application_controller_spec.rb
refinerycms-core-2.0.1 spec/lib/refinery/application_controller_spec.rb
refinerycms-core-2.0.0 spec/lib/refinery/application_controller_spec.rb