Guest User

Untitled

a guest
Jun 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. describe "handling GET /sponsors" do
  2.  
  3. before(:each) do
  4. @sponsor = mock_model(Sponsor)
  5. @store.sponsors.stub!(:find).and_return([@sponsor])
  6. end
  7.  
  8. def do_get
  9. get :index, :store_id => "1"
  10. end
  11.  
  12. it "should be successful" do
  13. do_get
  14. response.should be_success
  15. end
  16.  
  17. it "should render index template" do
  18. do_get
  19. response.should render_template('index')
  20. end
  21.  
  22. it "should find all sponsors" do
  23. @store.sponsors.should_receive(:find).with(:all).and_return([@sponsor])
  24. do_get
  25. end
  26.  
  27. it "should assign the found sponsors for the view" do
  28. do_get
  29. assigns[:sponsors].should == [@sponsor]
  30. end
  31. end
Add Comment
Please, Sign In to add comment