Sha256: f381bf756ccc212a31b31bb930e0404b361e1c79aae07615fd8d524495ed3242
Contents?: true
Size: 1.61 KB
Versions: 16
Compression:
Stored size: 1.61 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ProductsController do describe "Normal products route recognition" do it "should generate params { :controller => 'products', action => 'index' } from GET /products" do params_from(:get, "/products").should == {:controller => "products", :action => "index"} end it "should generate params { :controller => 'products', action => 'show', id => '1' } from GET /products" do params_from(:get, "/products/1").should == {:controller => "products", :action => "show", :id => "1"} end end describe "Nested taxons with products route recognition" do it "should generate params { :controller => 'products', action => 'show', id => 'ruby-on-rails-jr-spaghetti', taxon_path=>['categories', 'clothing', 'shirts']} from GET /t/categories/clothing/shirts/p/ruby-on-rails-jr-spaghetti" do params_from(:get, "/t/categories/clothing/shirts/p/ruby-on-rails-jr-spaghetti").should == {:controller => "products", :action => "show", :id => 'ruby-on-rails-jr-spaghetti', :taxon_path => ['categories', 'clothing', 'shirts']} end it "should generate params { :controller => 'products', action => 'show', id => 'apache-baseball-jersey', taxon_path=>['categories', 'clothing', 'shirts']} from GET /t/categories/clothing/shirts/t-shirts/p/apache-baseball-jersey" do params_from(:get, "/t/categories/clothing/shirts/t-shirts/p/apache-baseball-jersey").should == {:controller => "products", :action => "show", :id => 'apache-baseball-jersey', :taxon_path => ['categories', 'clothing', 'shirts', 't-shirts']} end end end
Version data entries
16 entries across 16 versions & 3 rubygems