Sha256: 3f55127e12fe334b7d4de661dc405f89b8083e6d9b85ba1622eff7c60ffe8c4f
Contents?: true
Size: 859 Bytes
Versions: 3
Compression:
Stored size: 859 Bytes
Contents
def should_support_on_duplicate_key_ignore describe "#import" do extend ActiveSupport::TestCase::ImportAssertions let(:topic) { Topic.create!(title: "Book", author_name: "John Doe") } let(:topics) { [topic] } context "with :on_duplicate_key_ignore" do it "should skip duplicates and continue import" do topics << Topic.new(title: "Book 2", author_name: "Jane Doe") assert_difference "Topic.count", +1 do Topic.import topics, on_duplicate_key_ignore: true, validate: false end end end context "with :ignore" do it "should skip duplicates and continue import" do topics << Topic.new(title: "Book 2", author_name: "Jane Doe") assert_difference "Topic.count", +1 do Topic.import topics, ignore: true, validate: false end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems