Sha256: cfbaeb01ceb2e552f0afb07efe592e5b95c8a7a8b12fa3ae455574422d0748b9

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

# encoding: UTF-8
def should_support_postgresql_import_functionality
  describe "#supports_imports?" do
    it "should support import" do
      assert ActiveRecord::Base.supports_import?
    end
  end

  describe "#import" do
    it "should import with a single insert" do
      # see ActiveRecord::ConnectionAdapters::AbstractAdapter test for more specifics
      assert_difference "Topic.count", +10 do
        result = Topic.import Build(3, :topics)
        assert_equal 1, result.num_inserts

        result = Topic.import Build(7, :topics)
        assert_equal 1, result.num_inserts
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
activerecord-import-0.7.0 test/support/postgresql/import_examples.rb
activerecord-import-0.6.0 test/support/postgresql/import_examples.rb
activerecord-import-0.5.0 test/support/postgresql/import_examples.rb
activerecord-import-0.4.1 test/support/postgresql/import_examples.rb
activerecord-import-0.4.0 test/support/postgresql/import_examples.rb
activerecord-import-rails4-0.5.0 test/support/postgresql/import_examples.rb