diff --git a/spec/models/article_version_spec.rb b/spec/models/article_version_spec.rb index 6a9f302e..99e52f18 100644 --- a/spec/models/article_version_spec.rb +++ b/spec/models/article_version_spec.rb @@ -36,11 +36,15 @@ article.update(latest_article_version_attributes: new_attributes.merge(id: article_version.id)) + new_version = article.latest_article_version + version_in_order = order.order_articles.first.reload.article_version + + expect(original_version_id).not_to eq new_version.id + expect(original_version_id).to eq version_in_order.id new_attributes.each do |key, value| - expect(article.latest_article_version[key]).to eq value - expect(order.order_articles.first.article_version[key]).to eq original_version[key] + expect(new_version[key]).to eq value + expect(version_in_order[key]).to eq(original_version[key]), "'#{key}' property changed: Old {#{original_version[key]}} <-> Current {#{version_in_order[key]}}" end - expect(original_version_id).not_to eq article.latest_article_version.id end end