Sha256: ad3e7db0aed1a181f42731046a2dce6c0d2dbddf36e0b8e8d11cf939f23cc1f2

Contents?: true

Size: 999 Bytes

Versions: 5

Compression:

Stored size: 999 Bytes

Contents

require "spec_helper"

describe PostsController do
  
  describe "routing" do
    
    before do
      # Use blogit's routes instead
      @routes = Blogit::Engine.routes
    end
    
    it "routes /posts/page/:page to posts#index with page param" do
      { get: "posts/page/2" }.should route_to({
        controller: "blogit/posts",
        action: "index",
        page: "2"
      })
    end
    
    it "routes /posts/tagged/:tag to posts#tagged with tag param" do
      { get: "posts/tagged/Spiceworld" }.should route_to({
        controller: "blogit/posts",
        action: "tagged",
        tag: "Spiceworld"
      })      
    end


    describe "when Blogit.configuration.include_admin_actions is true" do

      before do
        Blogit.configuration.include_admin_actions = true
      end
      
    end

    describe "when Blogit.configuration.include_admin_actions is false" do

      before do
        Blogit.configuration.include_admin_actions = false 
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blogit-0.5.1 spec/routing/post_routing_spec.rb
blogit-0.5.0 spec/routing/post_routing_spec.rb
blogit-0.4.8 spec/routing/post_routing_spec.rb
blogit-0.4.7 spec/routing/post_routing_spec.rb
blogit-0.4.6 spec/routing/post_routing_spec.rb