demarches-normaliennes/spec/views/administrateurs/procedures/edit.html.haml_spec.rb

24 lines
642 B
Ruby
Raw Normal View History

2023-05-03 11:35:15 +02:00
RSpec.describe 'administrateurs/procedures/edit', type: :view do
2023-05-31 17:04:21 +02:00
let(:procedure) { create(:procedure, lien_site_web: 'http://some.website') }
context 'when opendata is enabled' do
it 'asks for opendata' do
Rails.application.config.ds_opendata_enabled = true
assign(:procedure, procedure)
render
expect(rendered).to have_content('Open data')
end
end
context 'when opendata is disabled' do
it 'asks for opendata' do
Rails.application.config.ds_opendata_enabled = nil
assign(:procedure, procedure)
render
expect(rendered).not_to have_content('Open data')
end
end
2017-04-04 15:27:04 +02:00
end