spec/mongoid/token_spec.rb in mongoid_token-0.9.0 vs spec/mongoid/token_spec.rb in mongoid_token-0.9.1

- old
+ new

@@ -98,6 +98,12 @@ Account.create(:name => "A random company #{index}") end Account.find_by_token(@account.token).id.should == @account.id Account.find_by_token(Account.last.token).id.should == Account.last.id end + + it "should create a token, if the token is missing" do + @account.token = nil + @account.save! + @account.token.should_not be_nil + end end