Sha256: 56611d2935c761f8bb59634733809ca2adbdc8949b2b01476f4f07333e84e1ae

Contents?: true

Size: 680 Bytes

Versions: 114

Compression:

Stored size: 680 Bytes

Contents

require 'test_helper'

class TestAccount < ::Test::Unit::TestCase
  
  def test_create_account
    account = FactoryGirl.create(:account)
    assert account.id
  end
  
  def test_create_invalid_account
    account = FactoryGirl.build(:account, :email => nil)
    account.save
    assert account.errors[:email]
  end
  
  def test_search_email
    account = FactoryGirl.create(:account)
    matches = MLS::Account.search(account.email)
    assert_equal [account].map(&:id), matches.map(&:id)
  end

  def test_search_name
    account = FactoryGirl.create(:account)
    matches = MLS::Account.search(account.name)
    assert_equal [account].map(&:id), matches.map(&:id)
  end

end

Version data entries

114 entries across 114 versions & 1 rubygems

Version Path
mls-1.1.3 test/units/models/test_account.rb
mls-1.1.2 test/units/models/test_account.rb
mls-1.1.1 test/units/models/test_account.rb
mls-1.1.0 test/units/models/test_account.rb
mls-1.0.0 test/units/models/test_account.rb
mls-0.14.0 test/units/models/test_account.rb
mls-0.13.0 test/units/models/test_account.rb
mls-0.12.5 test/units/models/test_account.rb
mls-0.12.4 test/units/models/test_account.rb
mls-0.12.2 test/units/models/test_account.rb
mls-0.12.3 test/units/models/test_account.rb
mls-0.12.1 test/units/models/test_account.rb
mls-0.11.3 test/units/models/test_account.rb
mls-0.11.2 test/units/models/test_account.rb
mls-0.11.1 test/units/models/test_account.rb
mls-0.11.0 test/units/models/test_account.rb
mls-0.9.9 test/units/models/test_account.rb
mls-0.9.8 test/units/models/test_account.rb
mls-0.9.6 test/units/models/test_account.rb
mls-0.9.5 test/units/models/test_account.rb