Use match_array instead of eq to ignore ordering (#5308)

This commit is contained in:
Molly Struve 2019-12-30 14:38:55 -06:00 committed by Mac Siri
parent d7174923a2
commit 8aa9eb3534
2 changed files with 4 additions and 4 deletions

View file

@ -90,7 +90,7 @@ RSpec.describe Exporter::Articles, type: :service do
exporter = valid_instance(user)
result = exporter.export(slug: article.slug)
articles = load_articles(result)
expect(articles.first.keys).to eq(expected_fields)
expect(articles.first.keys).to match_array(expected_fields)
end
end
@ -107,7 +107,7 @@ RSpec.describe Exporter::Articles, type: :service do
exporter = valid_instance(article.user)
result = exporter.export
articles = load_articles(result)
expect(articles.first.keys).to eq(expected_fields)
expect(articles.first.keys).to match_array(expected_fields)
end
end
end

View file

@ -74,7 +74,7 @@ RSpec.describe Exporter::Comments, type: :service do
exporter = valid_instance(user)
result = exporter.export(id_code: comment.id_code)
comments = load_comments(result)
expect(comments.first.keys).to eq(expected_fields)
expect(comments.first.keys).to match_array(expected_fields)
end
end
@ -91,7 +91,7 @@ RSpec.describe Exporter::Comments, type: :service do
exporter = valid_instance(comment.user)
result = exporter.export
comments = load_comments(result)
expect(comments.first.keys).to eq(expected_fields)
expect(comments.first.keys).to match_array(expected_fields)
end
end