From 6f7865568e74f8268d067c4f961ece9dd4a76d41 Mon Sep 17 00:00:00 2001 From: Zog Date: Thu, 3 May 2018 09:17:31 +0200 Subject: Refs #6921; Show "Unarchive" action in referentials list --- spec/decorators/referential_decorator_spec.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'spec/decorators') diff --git a/spec/decorators/referential_decorator_spec.rb b/spec/decorators/referential_decorator_spec.rb index 98546f28b..88c7df666 100644 --- a/spec/decorators/referential_decorator_spec.rb +++ b/spec/decorators/referential_decorator_spec.rb @@ -100,7 +100,10 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do end context 'archived referential' do - before { referential.archived_at = 42.seconds.ago } + before { + referential.ready = true + referential.archived_at = 42.seconds.ago + } context 'no rights' do it 'has only show and calendar actions' do expect_action_link_hrefs.to eq([[object], referential_time_tables_path(object)]) @@ -118,6 +121,19 @@ RSpec.describe ReferentialDecorator, type: [:helper, :decorator] do ]) end end + + context 'all rights and same organisation' do + let( :user ){ build_stubbed :allmighty_user, organisation: referential.organisation } + it 'has only default actions' do + expect_action_link_elements.to eq ["Consulter", "Calendriers", "Dupliquer", "Désarchiver"] + expect_action_link_hrefs.to eq([ + [object], + referential_time_tables_path(object), + new_workbench_referential_path(referential.workbench, from: object.id), + unarchive_referential_path(object), + ]) + end + end end end -- cgit v1.2.3