diff options
| author | Xinhui | 2017-07-03 17:15:49 +0200 |
|---|---|---|
| committer | Xinhui | 2017-07-03 17:15:49 +0200 |
| commit | 433c498ac44aac684f0165265e3da437cafa3243 (patch) | |
| tree | 725c097f40a6948e10671068369c8fb852c50e98 /spec | |
| parent | adc8e323d6f76baf50d649b47bf83f08468681c0 (diff) | |
| download | chouette-core-433c498ac44aac684f0165265e3da437cafa3243.tar.bz2 | |
Workbench#show filtering restore q_for_result
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/workbenches_spec.rb | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/spec/features/workbenches_spec.rb b/spec/features/workbenches_spec.rb index 3c7d03bcb..2f453389d 100644 --- a/spec/features/workbenches_spec.rb +++ b/spec/features/workbenches_spec.rb @@ -42,24 +42,31 @@ describe 'Workbenches', type: :feature do end end - # context 'filter by organisation' do - # it 'should be possible to filter by organisation' do - # find("#q_organisation_name_eq_any_#{@user.organisation.name.parameterize.underscore}").set(true) - # click_button 'Filtrer' + context 'filter by organisation' do + it 'should be possible to filter by organisation' do + find("#q_organisation_name_eq_any_#{@user.organisation.name.parameterize.underscore}").set(true) + click_button 'Filtrer' - # expect(page).to have_content(referential.name) - # expect(page).not_to have_content(other_referential.name) - # end + expect(page).to have_content(referential.name) + expect(page).not_to have_content(other_referential.name) + end - # it 'should be possible to filter by multiple organisation' do - # find("#q_organisation_name_eq_any_#{@user.organisation.name.parameterize.underscore}").set(true) - # find("#q_organisation_name_eq_any_#{another_organisation.name.parameterize.underscore}").set(true) - # click_button 'Filtrer' + it 'should be possible to filter by multiple organisation' do + find("#q_organisation_name_eq_any_#{@user.organisation.name.parameterize.underscore}").set(true) + find("#q_organisation_name_eq_any_#{another_organisation.name.parameterize.underscore}").set(true) + click_button 'Filtrer' - # expect(page).to have_content(referential.name) - # expect(page).to have_content(other_referential.name) - # end - # end + expect(page).to have_content(referential.name) + expect(page).to have_content(other_referential.name) + end + + it 'should keep filter value on submit' do + box = "#q_organisation_name_eq_any_#{another_organisation.name.parameterize.underscore}" + find(box).set(true) + click_button 'Filtrer' + expect(find(box)).to be_checked + end + end context 'filter by status' do it 'should display archived referentials' do @@ -89,6 +96,12 @@ describe 'Workbenches', type: :feature do expect(page).to have_content(referential.name) expect(page).to_not have_content(other_referential.name) end + + it 'should keep filter value on submit' do + find("#q_archived_at_null").set(true) + click_button 'Filtrer' + expect(find("#q_archived_at_null")).to be_checked + end end end |
