diff options
| author | Xinhui | 2017-07-03 16:23:00 +0200 |
|---|---|---|
| committer | Xinhui | 2017-07-03 16:35:51 +0200 |
| commit | adc8e323d6f76baf50d649b47bf83f08468681c0 (patch) | |
| tree | f7b01912df37e67e522f3c86f5ec6c7e0a548616 /spec | |
| parent | 69723fff92b21b4fff722cefe1ca169ed308f5b2 (diff) | |
| download | chouette-core-adc8e323d6f76baf50d649b47bf83f08468681c0.tar.bz2 | |
Refactoring workbench_controller ransack_status
refs #3936
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/workbenches_spec.rb | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/spec/features/workbenches_spec.rb b/spec/features/workbenches_spec.rb index 0d05711ca..3c7d03bcb 100644 --- a/spec/features/workbenches_spec.rb +++ b/spec/features/workbenches_spec.rb @@ -42,22 +42,52 @@ 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) + # 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 + + # 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 + + context 'filter by status' do + it 'should display archived referentials' do + other_referential.update_attribute(:archived_at, Date.today) + find("#q_archived_at_not_null").set(true) + click_button 'Filtrer' + expect(page).to have_content(other_referential.name) + expect(page).to_not have_content(referential.name) + end + it 'should display both archived and unarchived referentials' do + other_referential.update_attribute(:archived_at, Date.today) + find("#q_archived_at_not_null").set(true) + find("#q_archived_at_null").set(true) + + click_button 'Filtrer' expect(page).to have_content(referential.name) - expect(page).not_to have_content(other_referential.name) + expect(page).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 display unarchived referentials' do + other_referential.update_attribute(:archived_at, Date.today) + find("#q_archived_at_null").set(true) + click_button 'Filtrer' expect(page).to have_content(referential.name) - expect(page).to have_content(other_referential.name) + expect(page).to_not have_content(other_referential.name) end end end |
