We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e08fff0 commit f130b45Copy full SHA for f130b45
spec/integration/associations/has_one_spec.rb
@@ -255,4 +255,18 @@
255
end
256
257
258
+
259
+ context "when overwriting an association" do
260
+ let(:post1) { HomPost.create!(title: "post 1") }
261
+ let(:post2) { HomPost.create!(title: "post 2") }
262
+ let(:comment) { HomComment.create(post: post1) }
263
264
+ it "does not overwrite the original value" do
265
+ pending "MONGOID-3999"
266
+ p1 = comment.post
267
+ expect(p1.title).to eq("post 1")
268
+ comment.post = post2
269
270
+ end
271
272
0 commit comments