Sha256: 763e92ac0ac5b27bf0e10aa803f0b1dbb49d910f7e24f91c82218954e45c28db

Contents?: true

Size: 1.36 KB

Versions: 4

Compression:

Stored size: 1.36 KB

Contents

require "spec_helper"

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

describe "mobile-optional routing" do
  it "routes /two to test#two" do
    expect(get: "/two").to route_to({
      controller: "test",
      action: "two",
      mobile: nil
    })
  end
  
  it "routes /#{MobileEnhancements.configuration.mobile_path_prefix}/two to test#two" 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 /three" do
    expect(get: "/three").not_to be_routable
  end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mobile-enhancements-0.0.5 spec/routing/routes_spec.rb
mobile-enhancements-0.0.4 spec/routing/routes_spec.rb
mobile-enhancements-0.0.3 spec/routing/routes_spec.rb
mobile-enhancements-0.0.2 spec/routing/routes_spec.rb