Skip to content

Commit

Permalink
On #8: More output to get to the cause of failing tests on github
Browse files Browse the repository at this point in the history
  • Loading branch information
lentschi committed Apr 28, 2024
1 parent 0773a13 commit 894b279
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/models/article_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@

article.update(latest_article_version_attributes: new_attributes.merge(id: article_version.id))

puts "ID: #{original_version_id} <-> #{order.order_articles.first.article_version.id}"
new_version.attributes.except('id').each_key do |key|
puts "#{original_version[key] == order.order_articles.first.article_version[key] ? 'EQ' : 'NEQ'}: '#{key}': {#{original_version[key]}} <-> {#{order.order_articles.first.article_version[key]}}"
end

expect(original_version_id).not_to eq article.latest_article_version.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(order.order_articles.first.article_version[key]).to eq(original_version[key]), "'#{key}' property changed: Old {#{original_version[key]}} <-> Current {#{order.order_articles.first.article_version[key]}}"
end
expect(original_version_id).not_to eq article.latest_article_version.id
end
end

Expand Down

0 comments on commit 894b279

Please sign in to comment.