Guest User

Untitled

a guest
Apr 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. describe 'Public images finder' do
  2. fixtures :pictures
  3.  
  4. it 'should_not incude hidden' do
  5. Picture.with_hidden_scope(false) do
  6. Picture.find(:all)
  7. end.should_not include(pictures(:hidden))
  8. end
  9. end
  10.  
  11. describe Picture, 'public scope' do
  12. fixtures :pictures
  13.  
  14. before :each do
  15. @pictures = Picture.with_public_scope { Picture.find(:all) }
  16. end
  17.  
  18. it 'should not include hidden pictures' do
  19. @pictures.should_not include(pictures(:hidden))
  20. end
  21.  
  22. it 'should include appropriate' do
  23. @pictures.should include(pictures(:appropriate))
  24. end
  25.  
  26. it 'should not include inappropriate' do
  27. @pictures.should_not include(pictures(:inappropriate))
  28. end
  29. end
Add Comment
Please, Sign In to add comment