Sha256: f1703330f9a740037b4282cec00d7c2692ed4929520d1128f03e75e287e40f9e

Contents?: true

Size: 1.14 KB

Versions: 9

Compression:

Stored size: 1.14 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

describe ArticlesController do
  describe "route generation" do
    it "should map #index" do
      route_for(:controller => "articles", :action => "index").should == "/"
    end
    
    it "should map #index with rss format" do
      route_for(:controller => "articles", :action => "index", :format => "rss").should == "/articles.rss"
    end
    
    it "should map #index with atom format" do
      route_for(:controller => "articles", :action => "index", :format => "atom").should == "/articles.atom"
    end
  end

  describe "route recognition" do
    it "should generate params for #index" do
      params_from(:get, "/").should == {:controller => "articles", :action => "index"}
    end
    
    it "should generate params for #index with rss format" do
      params_from(:get, "/articles.rss").should == {:controller => "articles", :action => "index", :format => "rss"}
    end
    
    it "should generate params for #index with atom format" do
      params_from(:get, "/articles.atom").should == {:controller => "articles", :action => "index", :format => "atom"}
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
typo-5.4.4 spec/controllers/routes/articles_routing_spec.rb
typo-5.4.3 spec/controllers/routes/articles_routing_spec.rb
typo-5.4.2 spec/controllers/routes/articles_routing_spec.rb
typo-5.4.1 spec/controllers/routes/articles_routing_spec.rb
typo-5.4 spec/controllers/routes/articles_routing_spec.rb
typo-5.1.98 spec/controllers/routes/articles_routing_spec.rb
typo-5.2 spec/controllers/routes/articles_routing_spec.rb
typo-5.2.98 spec/controllers/routes/articles_routing_spec.rb
typo-5.3 spec/controllers/routes/articles_routing_spec.rb