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

Version Path
kdmny-spree-0.0.1 spec/controllers/products_controller_spec.rb
spree-enriquez-0.9.4 spec/controllers/products_controller_spec.rb
spree-0.9.4 spec/controllers/products_controller_spec.rb
spree-0.9.3 spec/controllers/products_controller_spec.rb
spree-0.9.2 spec/controllers/products_controller_spec.rb
spree-0.9.1 spec/controllers/products_controller_spec.rb
spree-0.9.0 spec/controllers/products_controller_spec.rb
spree-0.8.4 spec/controllers/products_controller_spec.rb
spree-0.8.5 spec/controllers/products_controller_spec.rb
spree-0.6.0 spec/controllers/products_controller_spec.rb
spree-0.7.0 spec/controllers/products_controller_spec.rb
spree-0.7.1 spec/controllers/products_controller_spec.rb
spree-0.8.0 spec/controllers/products_controller_spec.rb
spree-0.8.1 spec/controllers/products_controller_spec.rb
spree-0.8.2 spec/controllers/products_controller_spec.rb
spree-0.8.3 spec/controllers/products_controller_spec.rb