Sha256: 78ba0562aa2923cebaeb9033b3c90a76ea413ccc11b67f3c85bea6aadec2a63d
Contents?: true
Size: 1.46 KB
Versions: 16
Compression:
Stored size: 1.46 KB
Contents
require "test_helper" module PushType describe Authenticatable do let(:user) { PushType::User.new } describe 'database_athenticatable' do it { user.methods.include?(:password).must_equal true } it { user.methods.include?(:password_confirmation).must_equal true } end describe 'confirmable' do it { user.methods.include?(:confirm!).must_equal true } end describe 'recoverable' do it { user.methods.include?(:reset_password!).must_equal true } end describe 'rememberable' do it { user.methods.include?(:remember_me).must_equal true } end describe 'trackable' do it { user.methods.include?(:update_tracked_fields!).must_equal true } end describe 'validatable' do it { user.methods.include?(:password_required?).must_equal true } it { user.methods.include?(:email_required?).must_equal true } end describe '#password_required?' do subject { user.send(:password_required?) } describe 'with new user' do let(:user) { PushType::User.new } it { subject.must_equal false } end describe 'with existing user and clean password' do let(:user) { FactoryGirl.create :user } it { subject.must_equal false } end describe 'with existing user and dirty password' do let(:user) { FactoryGirl.create :user } before { user.password = 'newpassword' } it { subject.must_equal true } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems