Sha256: b385b0006116e6b99dbd5091ce61af91c446607c1c8b5d793e910bb4addb2b0c

Contents?: true

Size: 583 Bytes

Versions: 18

Compression:

Stored size: 583 Bytes

Contents

require "test_helper"


class ReplaceStrategyTest < ActiveSupport::TestCase

  setup do
    options.merge!(strategy: {students: :replace})
  end



  context "When records already exist" do
    setup do
      plan do |import|
        import.students
      end
      account.students.create!(name: "Ron Weasley", legacy_id: 457)
    end

    should "reimport the existing records" do
      import!
      assert_equal "Gryffindor", account.students.find_by_name("Ron Weasley").house,
        "Expected Ron's record to have been replaced with one that has a house"
    end
  end



end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
abstract_importer-1.9.0 test/replace_strategy_test.rb
abstract_importer-1.8.0 test/replace_strategy_test.rb
abstract_importer-1.7.0 test/replace_strategy_test.rb
abstract_importer-1.6.0 test/replace_strategy_test.rb
abstract_importer-1.5.6 test/replace_strategy_test.rb
abstract_importer-1.5.5 test/replace_strategy_test.rb
abstract_importer-1.5.4 test/replace_strategy_test.rb
abstract_importer-1.5.3 test/replace_strategy_test.rb
abstract_importer-1.5.2 test/replace_strategy_test.rb
abstract_importer-1.5.1 test/replace_strategy_test.rb
abstract_importer-1.5.0 test/replace_strategy_test.rb
abstract_importer-1.4.1 test/replace_strategy_test.rb
abstract_importer-1.4.0 test/replace_strategy_test.rb
abstract_importer-1.3.4 test/replace_strategy_test.rb
abstract_importer-1.3.3 test/replace_strategy_test.rb
abstract_importer-1.3.2 test/replace_strategy_test.rb
abstract_importer-1.3.1 test/replace_strategy_test.rb
abstract_importer-1.3.0 test/replace_strategy_test.rb