Guest User

Untitled

a guest
Dec 10th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. ## app/controllers/public_controller.rb
  2. class PublicController < ApplicationController
  3. end
  4.  
  5. ## app/controllers/events_controller.rb
  6. class EventsController < ApplicationController
  7. end
  8.  
  9. ## spec/controllers/public_controller_spec.rb
  10. require 'spec_helper'
  11.  
  12. describe PublicController do
  13. describe 'about' do
  14. before do
  15. get :about
  16. end
  17.  
  18. it 'should render the about template' do
  19. response.should render_template(:about)
  20. end
  21. end
  22. end
  23.  
  24. ## spec/controllers/events_controller_spec.rb
  25. require 'spec_helper'
  26.  
  27. describe EventsController do
  28. describe 'index' do
  29. before do
  30. get :index
  31. end
  32.  
  33. it 'should render the index template' do
  34. response.should render_template(:index)
  35. end
  36. end
  37. end
  38.  
  39. ## `rake spec:controllers`
  40. F.
  41.  
  42. Failures:
  43.  
  44. 1) EventsController index should render the index template
  45. Failure/Error: response.should render_template(:index)
  46. Expected block to return true value.
  47. # ./spec/controllers/events_controller_spec.rb:11:in `block (3 levels) in <top (required)>'
Add Comment
Please, Sign In to add comment