spec/routing/routes_spec.rb in mobile-enhancements-0.0.1 vs spec/routing/routes_spec.rb in mobile-enhancements-0.0.2

- old
+ new

@@ -1,39 +1,47 @@ require "spec_helper" describe "standard routing" do - it "routes /guides to guides#index" 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 /items to items#index" do + it "routes /two to test#two" do expect(get: "/two").to route_to({ controller: "test", action: "two", mobile: nil }) end - it "routes /mobile/items to mobile#index" do + 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 /pages to pages#index" do + it "does not route /three" do expect(get: "/three").not_to be_routable end - it "routes /mobile/pages to pages#index" do + 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 \ No newline at end of file