diff options
Diffstat (limited to 'spec/controllers')
| -rw-r--r-- | spec/controllers/autocomplete_time_tables_controller_spec.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/controllers/autocomplete_time_tables_controller_spec.rb b/spec/controllers/autocomplete_time_tables_controller_spec.rb index 5cc0eced0..85a8eb714 100644 --- a/spec/controllers/autocomplete_time_tables_controller_spec.rb +++ b/spec/controllers/autocomplete_time_tables_controller_spec.rb @@ -6,6 +6,8 @@ RSpec.describe AutocompleteTimeTablesController, type: :controller do let(:referential) { Referential.first } let(:other_referential) { create :referential } let!(:time_table) { create :time_table, comment: 'écolà militaire' } + let!(:blargh) { create :time_table, comment: 'écolàë militaire' } + let!(:other_time_table) { create :time_table, comment: 'foo bar baz' } describe 'GET #index' do it 'should be successful' do @@ -17,13 +19,17 @@ RSpec.describe AutocompleteTimeTablesController, type: :controller do it 'should be successful' do get :index, referential_id: referential.id, q: {unaccented_comment_or_objectid_cont_any: 'écolà'}, :format => :json expect(response).to be_success - expect(assigns(:time_tables)).to eq([time_table]) + expect(assigns(:time_tables)).to include(time_table) + expect(assigns(:time_tables)).to include(blargh) + expect(assigns(:time_tables)).to_not include(other_time_table) end it 'should be accent insensitive' do get :index, referential_id: referential.id, q: {unaccented_comment_or_objectid_cont_any: 'ecola'}, :format => :json expect(response).to be_success - expect(assigns(:time_tables)).to eq([time_table]) + expect(assigns(:time_tables)).to include(time_table) + expect(assigns(:time_tables)).to include(blargh) + expect(assigns(:time_tables)).to_not include(other_time_table) end end end |
