<commit_before>require "spec_helper"

# TODO: Find out how to spec routes in a Mounted engine :S
describe PostsController do
  describe "routing" do
    
    before do
      Blogit.configuration.include_admin_actions = true
    end<commit_msg>Added some specs for routes<commit_after>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

{'fraction_non_alphanumeric': 0.09632034632034632, 'fraction_numerical': 0.0021645021645021645, 'mean_word_length': 2.451492537313433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5811083', 'n_tokens_mistral': 288, 'n_tokens_neox': 285, 'n_words': 85}