Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add failing test for destroyed records.

Also, generalize the previous test to use persisted? rather than !new_record?.
  • Loading branch information...
commit 413e35feddd8f86d16bfdab6b8291986ba2a8014 1 parent 31ff20a
@dougo dougo authored committed
Showing with 11 additions and 1 deletion.
  1. +11 −1 test/import_test.rb
View
12 test/import_test.rb
@@ -135,7 +135,17 @@
it "reloads data for existing in-memory instances" do
Topic.import(new_topics, :synchronize => new_topics, :synchronize_keys => [:title] )
- assert !new_topics.any?(&:new_record?), "Records should have been reloaded"
+ assert new_topics.all?(&:persisted?), "Records should have been reloaded"
+ end
+ end
+
+ context "synchronizing on destroyed records with explicit conditions" do
+ let(:new_topics) { Generate(3, :topics) }
+
+ it "reloads data for existing in-memory instances" do
+ new_topics.each &:destroy
+ Topic.import(new_topics, :synchronize => new_topics, :synchronize_keys => [:title] )
+ assert new_topics.all?(&:persisted?), "Records should have been reloaded"
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.