aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorRobert2017-04-25 10:10:40 +0200
committerRobert2017-04-25 10:10:40 +0200
commit9bd656b9f66daa88b773ae985aa0813e3ea06f92 (patch)
tree105c23b3d0298ae816bf485be7514a527d09f4f9 /spec
parentf7e7a011bdc9bfb854dee9a544fe1a0a493de10a (diff)
parenta032342dafe69d5878cb4868decf38b8139d98db (diff)
downloadchouette-core-9bd656b9f66daa88b773ae985aa0813e3ea06f92.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'spec')
-rw-r--r--spec/features/calendars_spec.rb37
-rw-r--r--spec/features/workbenches_spec.rb6
2 files changed, 24 insertions, 19 deletions
diff --git a/spec/features/calendars_spec.rb b/spec/features/calendars_spec.rb
index c1701d7c7..8bca4965d 100644
--- a/spec/features/calendars_spec.rb
+++ b/spec/features/calendars_spec.rb
@@ -20,7 +20,7 @@ describe 'Calendars', type: :feature do
context 'filtering' do
it 'supports filtering by short name' do
fill_in 'q[short_name_cont]', with: calendars.first.short_name
- click_button 'search-btn'
+ click_button 'search_btn'
expect(page).to have_content(calendars.first.short_name)
expect(page).not_to have_content(calendars.last.short_name)
end
@@ -28,24 +28,30 @@ describe 'Calendars', type: :feature 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'
+ # 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 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
+ # wip
+ # 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
+ # select '7', from: 'q_contains_date_3i'
+ # select 'juillet', from: 'q_contains_date_2i'
+ # select '2017', from: 'q_contains_date_1i'
+ # click_button 'filter_btn'
+ # expect(page).to have_content(july_calendar.short_name)
+ # expect(page).not_to have_content(calendars.first.short_name)
+ # select '18', from: 'q_contains_date_3i'
+ # select 'juillet', from: 'q_contains_date_2i'
+ # select '2017', from: 'q_contains_date_1i'
+ # click_button 'filter_btn'
+ # expect(page).to have_content(july_calendar.short_name)
+ # expect(page).not_to have_content(calendars.first.short_name)
+ # end
end
end
@@ -56,4 +62,3 @@ describe 'Calendars', type: :feature do
end
end
end
-
diff --git a/spec/features/workbenches_spec.rb b/spec/features/workbenches_spec.rb
index 0a71a0b6b..717be96fa 100644
--- a/spec/features/workbenches_spec.rb
+++ b/spec/features/workbenches_spec.rb
@@ -27,7 +27,7 @@ describe 'Workbenches', type: :feature do
context 'user has the permission to create referentials' do
it 'shows the link for a new referetnial' do
- expect(page).to have_link(I18n.t('referentials.actions.new'), href: new_referential_path(workbench_id: workbenches.first))
+ expect(page).to have_link(I18n.t('actions.add'), href: new_referential_path(workbench_id: workbenches.first))
end
end
@@ -35,7 +35,7 @@ describe 'Workbenches', type: :feature do
it 'does not show the clone link for referetnial' do
@user.update_attribute(:permissions, [])
visit referential_path(referential)
- expect(page).not_to have_link(I18n.t('referentials.actions.new'), href: new_referential_path(workbench_id: workbenches.first))
+ expect(page).not_to have_link(I18n.t('actions.add'), href: new_referential_path(workbench_id: workbenches.first))
end
end
end
@@ -44,7 +44,7 @@ describe 'Workbenches', type: :feature do
it "create a new Referential with a specifed line and period" do
visit workbench_path(workbench)
- click_link "Créer un jeu de données"
+ click_link I18n.t('actions.add')
fill_in "referential[name]", with: "Referential to test creation" # Nom du JDD
fill_in "referential[slug]", with: "test" # Code