Sha256: e8406b18e4a447ef838fbaf641cf52a0b14838aef7577aadb32b35df3d25ba9f

Contents?: true

Size: 690 Bytes

Versions: 23

Compression:

Stored size: 690 Bytes

Contents

require 'test_helper'

class ValidationTest < CassandraObjectTestCase
  
  test "save! raises an error" do
    begin
      customer = Customer.new :first_name=>"steve", :date_of_birth=>Date.parse("1979/12/25")
      customer.save!
      flunk "Should have failed to save"
    rescue CassandraObject::Validation::RecordInvalid => e
      assert_equal customer, e.record
    end
  end

  test "create! raises an error" do
    begin
      customer = Customer.create! :first_name=>"steve", :date_of_birth=>Date.parse("1979/12/25")
      flunk "Should have failed to create!"
    rescue CassandraObject::Validation::RecordInvalid => e
      assert_kind_of Customer, e.record
    end
  end


end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.2.0 test-old/validation_test.rb
gotime-cassandra_object-2.1.2 test-old/validation_test.rb
gotime-cassandra_object-2.1.1 test-old/validation_test.rb
gotime-cassandra_object-2.1.0 test-old/validation_test.rb
gotime-cassandra_object-2.0.0 test-old/validation_test.rb
gotime-cassandra_object-0.9.1 test/validation_test.rb
gotime-cassandra_object-0.9.0 test/validation_test.rb
gotime-cassandra_object-0.8.7 test/validation_test.rb
gotime-cassandra_object-0.8.6 test/validation_test.rb
gotime-cassandra_object-0.8.5 test/validation_test.rb
gotime-cassandra_object-0.8.4 test/validation_test.rb
gotime-cassandra_object-0.8.3 test/validation_test.rb
gotime-cassandra_object-0.8.2 test/validation_test.rb
gotime-cassandra_object-0.8.1 test/validation_test.rb
gotime-cassandra_object-0.8.0 test/validation_test.rb
gotime-cassandra_object-0.7.8 test/validation_test.rb
gotime-cassandra_object-0.7.7 test/validation_test.rb
gotime-cassandra_object-0.7.6 test/validation_test.rb
gotime-cassandra_object-0.7.5 test/validation_test.rb
gotime-cassandra_object-0.7.4 test/validation_test.rb