add auth token for users

This commit is contained in:
Nihad Abbasov 2011-11-15 11:08:05 +04:00
parent 8d74123d61
commit 003bf61258
5 changed files with 19 additions and 7 deletions

View file

@ -19,15 +19,20 @@ describe User do
user.identifier.should == "test_mail.com"
end
it "should have authentication token" do
user = Factory(:user)
user.authentication_token.should_not == ""
end
describe "dependent" do
before do
before do
@user = Factory :user
@note = Factory :note,
@note = Factory :note,
:author => @user,
:project => Factory(:project)
end
it "should destroy all notes with user" do
it "should destroy all notes with user" do
Note.find_by_id(@note.id).should_not be_nil
@user.destroy
Note.find_by_id(@note.id).should be_nil