Guest User

Untitled

a guest
Jul 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. require File.dirname(__FILE__) + '/../spec_helper'
  2.  
  3. describe AnimeRequest do
  4.  
  5. before do
  6. # Anime.destroy_all
  7. # AnimeRequest.destroy_all
  8. @anime = Factory(:anime)
  9. @anime_request = Factory(:anime_request)
  10. end
  11.  
  12. it "should be allowed to request" do
  13. Factory.build(:anime_request).should be_valid
  14. end
  15.  
  16. it "should be allowed to update" do
  17. @anime_request.should be_valid
  18. end
  19.  
  20. it "should not be allowed to request anime, because the request already exists" do
  21. AnimeRequest.new(:name => @anime_request.name).should_not be_valid
  22. end
  23.  
  24. it "should not be be allowed to request, because the anime already exists" do
  25. AnimeRequest.new(:name => @anime.name).should_not be_valid
  26. end
  27.  
  28. end
Add Comment
Please, Sign In to add comment