2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-10-26 11:44:53 +02:00
|
|
|
describe 'procedure locked' do
|
2024-06-01 22:50:48 +02:00
|
|
|
let(:administrateur) { administrateurs(:default_admin) }
|
2015-12-21 14:40:28 +01:00
|
|
|
|
|
|
|
before do
|
2019-09-17 12:24:24 +02:00
|
|
|
login_as administrateur.user, scope: :user
|
2020-07-15 10:48:11 +02:00
|
|
|
visit admin_procedure_publication_path(procedure)
|
2015-12-21 14:40:28 +01:00
|
|
|
end
|
|
|
|
|
2016-06-09 17:49:38 +02:00
|
|
|
context 'when procedure is not published' do
|
2019-09-17 12:24:24 +02:00
|
|
|
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
|
|
|
|
2015-12-21 14:40:28 +01:00
|
|
|
scenario 'info label is not present' do
|
2023-07-18 10:59:09 +02:00
|
|
|
expect(page).to have_content('Publier')
|
2019-09-17 12:24:24 +02:00
|
|
|
expect(page).not_to have_content('Cette démarche est publiée, certains éléments ne peuvent plus être modifiés.')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when procedure is published' do
|
|
|
|
let(:procedure) { create(:procedure, :published, administrateur: administrateur) }
|
|
|
|
|
|
|
|
scenario 'info label is present' do
|
2023-07-18 10:59:09 +02:00
|
|
|
expect(page).to have_content('Publier')
|
2019-09-17 12:24:24 +02:00
|
|
|
expect(page).to have_content('Cette démarche est publiée, certains éléments ne peuvent plus être modifiés.')
|
2015-12-21 14:40:28 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|