Guest User

Untitled

a guest
Jun 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. require "spec_helper"
  2.  
  3. describe PagesController do
  4.  
  5. describe "routing" do
  6. it "recognizes and generates #home" do
  7. { :get => "/pages/home" }.should route_to(:controller => "pages", :action => "home")
  8. end
  9.  
  10. context "when no user is signed in" do
  11. it "routes the root route to pages#home" do
  12. RootConstraints.stub!(:matches?).and_return(false)
  13. { :get => '/' }.should route_to(:controller => "pages", :action => "home")
  14. end
  15. end
  16.  
  17. context "when a user is already signed in" do
  18. it "routes the root route to 'lists#show/master" do
  19. RootConstraints.stub!(:matches?).and_return(true)
  20. { :get => '/' }.should route_to(:controller => "lists", :action => "show", :id => "master")
  21. end
  22. end
  23. end
  24. end
Add Comment
Please, Sign In to add comment