Sha256: 60e0280ced913b62de768e81f71a030566f3aca96d44d6213546fe938c86fd5e

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

require "spec_helper"

describe "standard routing" do
  it "routes /guides to guides#index" do
    expect(get: "/one").to route_to("test#one")
  end
end

describe "mobile-optional routing" do
  it "routes /items to items#index" do
    expect(get: "/two").to route_to({
      controller: "test",
      action: "two",
      mobile: nil
    })
  end
  
  it "routes /mobile/items to mobile#index" do
    expect(get: "/#{MobileEnhancements.configuration.mobile_path_prefix}/two").to route_to({
      controller: "test",
      action: "two",
      mobile: MobileEnhancements.configuration.mobile_path_prefix
    })
  end
end

describe "mobile-only routing" do
  it "does not route /pages to pages#index" do
    expect(get: "/three").not_to be_routable
  end

  it "routes /mobile/pages to pages#index" do
    expect(get: "/#{MobileEnhancements.configuration.mobile_path_prefix}/three").to route_to({
      controller: "test",
      action: "three",
      mobile: MobileEnhancements.configuration.mobile_path_prefix
    })
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mobile-enhancements-0.0.1 spec/routing/routes_spec.rb