demarches-normaliennes/spec/components/procedures/pending_republish_component_spec.rb

15 lines
528 B
Ruby
Raw Normal View History

describe Procedure::PendingRepublishComponent, type: :component do
subject { render_inline(described_class.new(render_if:, procedure: build(:procedure, id: 1))) }
let(:page) { subject }
describe 'render_if' do
context 'when false' do
let(:render_if) { false }
it { expect(page).not_to have_text('Ces modifications ne seront appliquées') }
end
context 'when true' do
let(:render_if) { true }
it { expect(page).to have_text('Ces modifications ne seront appliquées') }
end
end
end