aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorVlatka Pavisic2017-01-03 11:47:30 +0100
committerVlatka Pavisic2017-01-03 11:47:30 +0100
commitbac2e1b1bd9111580d161b3282f52460d49783ca (patch)
tree10a3bc645e3817b62b4f073b0a126ababda1b78f /spec
parentc246e91169a0acea798fba01bfb2d9a360ac3cb0 (diff)
downloadchouette-core-bac2e1b1bd9111580d161b3282f52460d49783ca.tar.bz2
Refs #2265 : Calendars search
Diffstat (limited to 'spec')
-rw-r--r--spec/features/calendars_spec.rb27
1 files changed, 24 insertions, 3 deletions
diff --git a/spec/features/calendars_spec.rb b/spec/features/calendars_spec.rb
index 354e211a3..9331427ef 100644
--- a/spec/features/calendars_spec.rb
+++ b/spec/features/calendars_spec.rb
@@ -15,13 +15,33 @@ describe 'Calendars', type: :feature do
end
context 'filtering' do
- xit 'supports filtering by short name' do
+ 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
- xit 'supports filtering by shared' do
+ it 'supports filtering by shared' do
+ shared_calendar = create :calendar, organisation_id: 1, shared: true
+ visit calendars_path
+ select I18n.t('calendars.index.shared'), from: 'q[shared_eq]'
+ click_button 'search-btn'
+ expect(page).to have_content(shared_calendar.short_name)
+ expect(page).not_to have_content(calendars.first.short_name)
end
- xit 'supports filtering by date' do
+ it 'supports filtering by date' do
+ july_calendar = create :calendar, dates: [Date.new(2017, 7, 7)], date_ranges: [Date.new(2017, 7, 15)..Date.new(2017, 7, 30)], organisation_id: 1
+ visit calendars_path
+ fill_in 'q_contains_date', with: '2017/07/07'
+ click_button 'search-btn'
+ expect(page).to have_content(july_calendar.short_name)
+ expect(page).not_to have_content(calendars.first.short_name)
+ fill_in 'q_contains_date', with: '2017/07/18'
+ click_button 'search-btn'
+ expect(page).to have_content(july_calendar.short_name)
+ expect(page).not_to have_content(calendars.first.short_name)
end
end
end
@@ -33,3 +53,4 @@ describe 'Calendars', type: :feature do
end
end
end
+