daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest May 16th, 2018 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe UrlPosts, "router" do
  2.   HASH = "8sdf7d8"
  3.  
  4.   it "dispatches GET to app root to UrlPosts#new" do
  5.     request_to("/", :get).should route_to(UrlPosts, :new)
  6.   end
  7.  
  8.   it "dispatches GET to /<7-and-more-alphanumerics> to UrlPosts#show" do
  9.     request_to("/#{HASH}", :get).should route_to(UrlPosts, :show)
  10.   end
  11.  
  12.   it "DOES NOT dispatch GET to /<2-and-more-alphanumerics> to UrlPosts#show" do
  13.     request_to("/8s", :get).should_not route_to(UrlPosts, :show)
  14.   end
  15.  
  16.   it "dispatches alphanumerics after / as :hash parameter" do
  17.     request_to("/#{HASH}").should route_to(UrlPosts, :show).with(:hash => HASH)
  18.   end
  19. end
RAW Paste Data
Top