aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpl2017-02-10 14:51:01 +0100
committerjpl2017-02-10 14:51:01 +0100
commitcc6744ecf9cf940417fabfaa34b0a857196352ae (patch)
tree879f73df8b8afae8895a41401f8e575e63023970
parentce0248b0a9773b70cdcb3ca681a74f0c353cec43 (diff)
downloadchouette-core-cc6744ecf9cf940417fabfaa34b0a857196352ae.tar.bz2
Refs #2482: fixing :show_all feature according to new specs (feat. Luc Donnet)
-rw-r--r--app/controllers/workbenches_controller.rb4
-rw-r--r--app/views/workbenches/show.html.slim5
-rw-r--r--spec/features/workbenches_spec.rb9
3 files changed, 2 insertions, 16 deletions
diff --git a/app/controllers/workbenches_controller.rb b/app/controllers/workbenches_controller.rb
index eb19da35c..b15765fdb 100644
--- a/app/controllers/workbenches_controller.rb
+++ b/app/controllers/workbenches_controller.rb
@@ -3,9 +3,7 @@ class WorkbenchesController < BreadcrumbController
respond_to :html, :only => [:show]
def show
- scope = Workbench.find(params[:id])
- scope = params[:show_all] ? scope.all_referentials : scope.referentials.ready
- # scope = scope.referentials
+ scope = Workbench.find(params[:id]).all_referentials
@q = scope.ransack(params[:q])
@collection = @q.result(distinct: true)
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index c83bd4dc2..57de20bb1 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -7,11 +7,6 @@
/ Below is secundary actions & optional contents (filters, ...)
.row
.col-lg-12.text-right
- - if params[:show_all]
- = link_to t('referentials.show.from_this_workbench'), workbench_path(@workbench.id), class: 'btn btn-primary', disabled: params[:archived]
- - else
- = link_to t('referentials.show.show_all_referentials'), workbench_path(@workbench.id, show_all: true), class: 'btn btn-primary'
-
= link_to t('referentials.actions.new'), new_referential_path(workbench_id: @workbench), class: 'btn btn-primary'
.row.mt-xs
diff --git a/spec/features/workbenches_spec.rb b/spec/features/workbenches_spec.rb
index 262991353..9e636341d 100644
--- a/spec/features/workbenches_spec.rb
+++ b/spec/features/workbenches_spec.rb
@@ -10,7 +10,7 @@ describe 'Workbenches', type: :feature do
let!(:line) { create :line, line_referential: line_referential }
let!(:referential_metadatas) { Array.new(2) { |i| create :referential_metadata, lines: [line], referential: referentials[i] } }
- let!(:ready_referential) { create(:referential, workbench: workbenches.first, ready: true) }
+ let!(:ready_referential) { create(:referential, workbench: workbenches.first, metadatas: referential_metadatas, ready: true) }
let!(:unready_referential) { create(:referential, workbench: workbenches.first) }
describe 'show' do
@@ -19,12 +19,5 @@ describe 'Workbenches', type: :feature do
expect(page).to have_content(ready_referential.name)
expect(page).not_to have_content(unready_referential.name)
end
-
- it 'shows all ready referentials if that option is chosen' do
- visit workbench_path(workbenches.first)
- click_link I18n.t('referentials.show.show_all_referentials')
- expect(page).to have_content(referentials.first.name)
- expect(page).to have_content(referentials.last.name)
- end
end
end