diff options
| author | Xinhui | 2017-04-25 15:41:51 +0200 |
|---|---|---|
| committer | Xinhui | 2017-04-25 15:41:51 +0200 |
| commit | 219c856566cb861cee82288adeda02cf5b9ca751 (patch) | |
| tree | 98e56d9d6e9ca83bce90633afc0727bdf682cfb9 /spec | |
| parent | 9399071affee50b3f92df0121374bec22cbc6e4c (diff) | |
| download | chouette-core-219c856566cb861cee82288adeda02cf5b9ca751.tar.bz2 | |
Fix calendar ransack filter
Refs #3173
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/calendars_spec.rb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/spec/features/calendars_spec.rb b/spec/features/calendars_spec.rb index bb30cff0f..d4234fc50 100644 --- a/spec/features/calendars_spec.rb +++ b/spec/features/calendars_spec.rb @@ -18,23 +18,22 @@ describe 'Calendars', type: :feature do end context 'filtering' do - # Fixme ! - # it 'supports filtering by short name' do - # fill_in 'q[short_name_cont]', with: calendars.first.short_name - # click_button 'search_btn' - # expect(page).to have_content(calendars.first.short_name) - # expect(page).not_to have_content(calendars.last.short_name) - # end + it 'supports filtering by short name' do + fill_in 'q[short_name_cont]', with: calendars.first.short_name + click_button 'search_btn' + expect(page).to have_content(calendars.first.short_name) + expect(page).not_to have_content(calendars.last.short_name) + end - # it 'supports filtering by shared' do - # shared_calendar = create :calendar, organisation_id: 1, shared: true - # visit calendars_path - # # select I18n.t('true'), from: 'q[shared]' - # find(:css, '#q_shared').set(true) - # click_button 'filter_btn' - # expect(page).to have_content(shared_calendar.short_name) - # expect(page).not_to have_content(calendars.first.short_name) - # end + it 'supports filtering by shared' do + shared_calendar = create :calendar, organisation_id: 1, shared: true + visit calendars_path + # select I18n.t('true'), from: 'q[shared]' + find(:css, '#q_shared_true').set(true) + click_button 'filter_btn' + expect(page).to have_content(shared_calendar.short_name) + expect(page).not_to have_content(calendars.first.short_name) + end # wip # it 'supports filtering by date' do |
