2015-12-21 14:40:28 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'procedure locked' do
|
|
|
|
let(:administrateur) { create(:administrateur) }
|
|
|
|
|
|
|
|
before do
|
2019-09-17 12:24:24 +02:00
|
|
|
login_as administrateur.user, scope: :user
|
2015-12-21 14:40:28 +01:00
|
|
|
visit admin_procedure_path(procedure)
|
|
|
|
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
|
2019-09-17 12:24:24 +02:00
|
|
|
expect(page).to have_content('Test et publication')
|
|
|
|
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
|
|
|
|
expect(page).to have_content('Publication')
|
|
|
|
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
|