Sha256: e4dfc3039bebb617c11e59403de78185a8ba8c94159cfae37a641f9e31bde68f

Contents?: true

Size: 920 Bytes

Versions: 8

Compression:

Stored size: 920 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe "Authenticated user" do

  before :all do
    @user = user.new
    @user.remember_token_expires_at.should be_nil
    @user.remember_token.should be_nil
  end

  it "should add the 'remember_token_expires_at' property to the user model" do
    @user.should respond_to(:remember_token_expires_at)
    @user.should respond_to(:remember_token_expires_at=)
  end

  it "should add the 'remember_token' property to the user model" do
    @user.should respond_to(:remember_token)
    @user.should respond_to(:remember_token=)
  end

  it "should save token and expires_at" do
    @user.remember_me
    @user.remember_token_expires_at.should_not be_nil
    @user.remember_token.should_not be_nil
  end

  it "should save expires_at as 2 weeks later" do
    @user.remember_me
    @user.remember_token_expires_at.should eql((Time.now+2.weeks).to_datetime)
  end

end


Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rughetto-merb-auth-remember-me-0.0.1 spec/mixins/authenticated_user_spec.rb
rughetto-merb-auth-remember-me-0.0.2 spec/mixins/authenticated_user_spec.rb
rughetto-merb-auth-remember-me-0.0.3 spec/mixins/authenticated_user_spec.rb
scottmotte-merb-auth-remember-me-0.0.2 spec/mixins/authenticated_user_spec.rb
scottmotte-merb-auth-remember-me-0.1.3.2 spec/mixins/authenticated_user_spec.rb
scottmotte-merb-auth-remember-me-0.2.1 spec/mixins/authenticated_user_spec.rb
scottmotte-merb-auth-remember-me-0.2.2 spec/mixins/authenticated_user_spec.rb
scottmotte-merb-auth-remember-me-0.2 spec/mixins/authenticated_user_spec.rb