Guest User

Untitled

a guest
May 31st, 2018
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. require File.expand_path(File.dirname(__FILE__) + '/../spec_helper.rb')
  2.  
  3. describe Account do
  4. it "should be able to get created with username and password" do
  5. user = Account.create(:username => "seivan", :password => "asdasd")
  6. user.should be_valid
  7. end
  8. it "should be able to get created with email and password" do
  9. user = Account.create(:email => "seivan@kth.se", :password => "asdasd")
  10. user.should be_valid
  11. end
  12. it "should be able to login with username and password" do
  13. user = Account.authenticate("seivan", "asdasd")
  14. user.should_not == nil
  15. end
  16. it "should be able to login with email and password" do
  17. user = Account.authenticate("seivan@kth.se", "asdasd")
  18. user.should_not == nil
  19. end
  20. end
Add Comment
Please, Sign In to add comment