spec/granite/form/model/dirty_spec.rb in granite-form-0.5.0 vs spec/granite/form/model/dirty_spec.rb in granite-form-0.6.0
- old
+ new
@@ -43,19 +43,22 @@
specify do
expect(Model.instantiate(author_id: other_author.id)
.tap { |m| m.update(author_id: author.id) }.changes)
.to eq('author_id' => [other_author.id, author.id])
end
+
specify do
expect(Model.instantiate(author_id: other_author.id)
.tap { |m| m.update(author: author) }.changes)
.to eq('author_id' => [other_author.id, author.id])
end
+
specify do
expect(Model.instantiate(author_ids: [other_author.id])
.tap { |m| m.update(author_ids: [author.id]) }.changes)
.to eq('author_ids' => [[other_author.id], [author.id]])
end
+
specify do
expect(Model.instantiate(author_ids: [other_author.id])
.tap { |m| m.update(authors: [author]) }.changes)
.to eq('author_ids' => [[other_author.id], [author.id]])
end