Commit 7fe25f4dbf844dd99d43413f535817363101e524
1 parent
b69e4d6a
Exists in
theme-brasil-digital-from-staging
and in
8 other branches
Fix unit test in api search
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
test/unit/api/search_test.rb
@@ -131,8 +131,7 @@ class SearchTest < ActiveSupport::TestCase | @@ -131,8 +131,7 @@ class SearchTest < ActiveSupport::TestCase | ||
131 | get "/api/v1/search/article?category_ids[]=#{category1.id}&category_ids[]=#{category2.id}" | 131 | get "/api/v1/search/article?category_ids[]=#{category1.id}&category_ids[]=#{category2.id}" |
132 | json = JSON.parse(last_response.body) | 132 | json = JSON.parse(last_response.body) |
133 | assert_equal 2, json['articles'].count | 133 | assert_equal 2, json['articles'].count |
134 | - assert_equal article1.id, json['articles'].first["id"] | ||
135 | - assert_equal article2.id, json['articles'].last["id"] | 134 | + assert_equivalent [article1.id, article2.id], json['articles'].map{|a| a['id']} |
136 | end | 135 | end |
137 | 136 | ||
138 | end | 137 | end |