diff options
| author | Zog | 2018-05-03 09:17:31 +0200 |
|---|---|---|
| committer | Zog | 2018-05-03 09:22:10 +0200 |
| commit | 6f7865568e74f8268d067c4f961ece9dd4a76d41 (patch) | |
| tree | 331ccb6f06d8d1251223a16c4b347aa255ef9ac3 /spec | |
| parent | b44aeae726ad588edb3bfffe5bbaa1bde3b71f04 (diff) | |
| download | chouette-core-6f7865568e74f8268d067c4f961ece9dd4a76d41.tar.bz2 | |
Refs #6921; Show "Unarchive" action in referentials list
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/decorators/referential_decorator_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
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 |
