Sha256: 3b536abb7503415261beb5328e0b247e92be27aa7c5319baef21703a5e5b878d

Contents?: true

Size: 522 Bytes

Versions: 11

Compression:

Stored size: 522 Bytes

Contents

# encoding: utf-8
$: << File.join(File.dirname(__FILE__), "..")
require 'test_helper'

class ActiveRecordTest < GeocoderTestCase

  def test_exclude_condition_when_model_has_a_custom_primary_key
    venue = PlaceWithCustomPrimaryKey.new(*geocoded_object_params(:msg))

    # just call private method directly so we don't have to stub .near scope
    conditions = venue.class.send(:add_exclude_condition, ["fake_condition"], venue)

    assert_match( /#{PlaceWithCustomPrimaryKey.primary_key}/, conditions.join)
  end

end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
geocoder-1.2.7 test/unit/active_record_test.rb
geocoder-kb-1.2.6 test/unit/active_record_test.rb
geocoder-1.2.6 test/unit/active_record_test.rb
bw-geocoder-1.2.6 test/unit/active_record_test.rb
bw-geocoder-1.2.5 test/unit/active_record_test.rb
geocoder-1.2.5 test/unit/active_record_test.rb
geocoder-1.2.4 test/unit/active_record_test.rb
geocoder-1.2.3 test/unit/active_record_test.rb
geocoder-1.2.2 test/unit/active_record_test.rb
geocoder-1.2.1 test/unit/active_record_test.rb
geocoder-1.2.0 test/unit/active_record_test.rb