Commit 65882f0949a733c4d1845c22d946f10b71b7ca9b
1 parent
bcf3cab2
Exists in
elasticsearch_sort
Fixed api tests
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
plugins/elasticsearch/test/unit/api/elasticsearch_plugin_api_test.rb
| @@ -9,8 +9,8 @@ class ElasticsearchPluginApiTest < ActiveSupport::TestCase | @@ -9,8 +9,8 @@ class ElasticsearchPluginApiTest < ActiveSupport::TestCase | ||
| 9 | end | 9 | end |
| 10 | 10 | ||
| 11 | def create_instances | 11 | def create_instances |
| 12 | - 7.times.each {|index| create_user "person_#{index}"} | ||
| 13 | - 4.times.each {|index| fast_create Community, name: "community_#{index}", created_at: Date.new } | 12 | + 7.times.each {|index| create_user "person #{index}"} |
| 13 | + 4.times.each {|index| fast_create Community, name: "community #{index}", created_at: Date.new } | ||
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | should 'show all types avaliable in /search/types endpoint' do | 16 | should 'show all types avaliable in /search/types endpoint' do |
| @@ -28,14 +28,14 @@ class ElasticsearchPluginApiTest < ActiveSupport::TestCase | @@ -28,14 +28,14 @@ class ElasticsearchPluginApiTest < ActiveSupport::TestCase | ||
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | should 'respond with query in downcase' do | 30 | should 'respond with query in downcase' do |
| 31 | - get "/api/v1/search?query=person_" | 31 | + get "/api/v1/search?query=person" |
| 32 | json = JSON.parse(last_response.body) | 32 | json = JSON.parse(last_response.body) |
| 33 | assert_equal 200, last_response.status | 33 | assert_equal 200, last_response.status |
| 34 | assert_equal 7, json["results"].count | 34 | assert_equal 7, json["results"].count |
| 35 | end | 35 | end |
| 36 | 36 | ||
| 37 | - should 'respond with query in upcase' do | ||
| 38 | - get "/api/v1/search?query=PERSON_" | 37 | + should 'respond with query in uppercase' do |
| 38 | + get "/api/v1/search?query=PERSON" | ||
| 39 | json = JSON.parse(last_response.body) | 39 | json = JSON.parse(last_response.body) |
| 40 | assert_equal 200, last_response.status | 40 | assert_equal 200, last_response.status |
| 41 | assert_equal 7, json["results"].count | 41 | assert_equal 7, json["results"].count |