Merge pull request #4335 from betagouv/fix-procedure-locked-spec
Fix procedure_locked_spec
This commit is contained in:
commit
1105766b26
1 changed files with 14 additions and 4 deletions
|
@ -2,17 +2,27 @@ require 'spec_helper'
|
||||||
|
|
||||||
feature 'procedure locked' do
|
feature 'procedure locked' do
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
let (:published_at) { nil }
|
|
||||||
let(:procedure) { create(:procedure, administrateur: administrateur, published_at: published_at) }
|
|
||||||
|
|
||||||
before do
|
before do
|
||||||
login_as administrateur, scope: :administrateur
|
login_as administrateur.user, scope: :user
|
||||||
visit admin_procedure_path(procedure)
|
visit admin_procedure_path(procedure)
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when procedure is not published' do
|
context 'when procedure is not published' do
|
||||||
|
let(:procedure) { create(:procedure, administrateur: administrateur) }
|
||||||
|
|
||||||
scenario 'info label is not present' do
|
scenario 'info label is not present' do
|
||||||
expect(page).not_to have_content('Cette démarche a été publiée, certains éléments ne peuvent plus être modifiés')
|
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.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue