Guest User

Untitled

a guest
May 23rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. describe "get index" do
  2. as_a(:visitor) {it_should_redirect_to {new_session_path}}
  3. as_a(:user) {it_should_render_template.permission_denied}
  4.  
  5. as_an :admin do
  6. before do
  7. @articles = [Article.new, Article.new]
  8. stub(Article).find(:all) {@articles}
  9. end
  10.  
  11. it_should_render_view Admin::Articles::Index
  12. it_should_render_layout Layouts::Admin
  13. it_should_set_rendered_view.articles.to {@articles}
  14. end
  15. end
Add Comment
Please, Sign In to add comment