Sha256: 338307abb23674754156076e2aeca7932618be4cf2e494e26805b0900a7efc78

Contents?: true

Size: 619 Bytes

Versions: 2

Compression:

Stored size: 619 Bytes

Contents

require 'test_helper'

class ContactTest < Test::Unit::TestCase
  include TestHelper
  
  def setup
    @client = Xeroizer::PublicApplication.new(CONSUMER_KEY, CONSUMER_SECRET)
    @contact = @client.Contact.build
  end
  
  context "contact validators" do
    
    should "have a name" do
      assert_equal(false, @contact.valid?)
      blank_error = @contact.errors_for(:name).first
      assert_not_nil(blank_error)
      assert_equal("can't be blank", blank_error)
      
      @contact.name = "SOMETHING"
      assert_equal(true, @contact.valid?)
      assert_equal(0, @contact.errors.size)
    end

  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xeroizer-2.16.1 test/unit/models/contact_test.rb
xeroizer-2.16.0 test/unit/models/contact_test.rb