Sha256: 9f397f9d26a038a784ce4fddcb638d00b03cd4e3d19742c2b18ac1b498c9ab5d

Contents?: true

Size: 907 Bytes

Versions: 22

Compression:

Stored size: 907 Bytes

Contents

require 'helper'

class TestMongoMapper < Test::Unit::TestCase

  def setup
    load_fixture 'mongo_mapper'
  end

  context 'for mongomapper functionality' do

    should 'check required fields' do
      account = Account.create
      assert ! account.valid?
    end

    should 'correctly create an account' do
      account = Account.create(:email => "jack@metal.org", :role => "some", :password => "some", :password_confirmation => "some")
      assert account.valid?
    end

    should 'correctly authenticate an account' do
      account = Account.create(:email => "auth@lipsia.org", :role => "some", :password => "some", :password_confirmation => "some")
      assert account.valid?
      assert ! account.id.nil?
      assert_equal "some", account.password_clean
      account_r = Account.first(:conditions => { :email => "auth@lipsia.org" })
      assert_equal account_r, account
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
padrino-admin-0.8.5 test/test_mongo_mapper.rb
padrino-admin-0.8.4 test/test_mongo_mapper.rb
padrino-admin-0.8.3 test/test_mongo_mapper.rb
padrino-admin-0.8.2 test/test_mongo_mapper.rb
padrino-admin-0.8.1 test/test_mongo_mapper.rb
padrino-admin-0.8.0 test/test_mongo_mapper.rb
padrino-admin-0.7.9 test/test_mongo_mapper.rb
padrino-admin-0.7.8 test/test_mongo_mapper.rb
padrino-admin-0.7.7 test/test_mongo_mapper.rb
padrino-admin-0.7.6 test/test_mongo_mapper.rb
padrino-admin-0.7.5 test/test_mongo_mapper.rb
padrino-admin-0.7.4 test/test_mongo_mapper.rb
padrino-admin-0.7.3 test/test_mongo_mapper.rb
padrino-admin-0.7.2 test/test_mongo_mapper.rb
padrino-admin-0.7.1 test/test_mongo_mapper.rb
padrino-admin-0.7.0 test/test_mongo_mapper.rb
padrino-admin-0.6.7 test/test_mongo_mapper.rb
padrino-admin-0.6.3 test/test_mongo_mapper.rb
padrino-admin-0.6.2 test/test_mongo_mapper.rb
padrino-admin-0.6.1 test/test_mongo_mapper.rb