btw it should be enough to add following code into the spec_helper.rb
to let my spec pass:
class Warden::SessionSerializer
def serialize(record)
record
end
def deserialize(keys)
keys
end
end
This stores directly the instance of user model in session instead of
its class and id, which is IMO just fine for unit tests. Later in
specs can be used:
@user = User.new
@user.stub!(:confirmed?).and_return(true) # This stubbing depends
on the model configuration.
sign_in @user
or alternatively:
@user = mock_model(User)
sign_in @user
May be it would be nice to add it to documentation or update the
helpers?
> How can Devise persist in session a record that does not even exist in
> the database? Try giving an existing record to sign_in and be sure it
> is active? and confirmed?
>
> Sent from my iPhone
>