Sha256: a93be87dbff57167c94d04e529e13b56f397894a18adec21db5f22a1b59a64ea

Contents?: true

Size: 790 Bytes

Versions: 10

Compression:

Stored size: 790 Bytes

Contents

# coding: utf-8
describe '/_flash_msg.html.erb', type: :view do
  before do
    allow(view).to receive(:flash).and_return(flash)
  end

  let(:flash) { { notice: notice } }
  let(:i18n_html) { t('hyrax.works.create.after_create_html', application_name: 'Whatever') }

  context 'with a single flash notice' do
    let(:notice) { i18n_html }
    it 'renders with HTML unescaped' do
      render
      expect(rendered).not_to have_content '</span>'
    end
  end

  context 'with multiple flash notices' do
    let(:notice) do
      [
        i18n_html,
        'Lorem ipsum!'
      ]
    end
    it 'renders the notice joined with unescaped line break' do
      render
      expect(rendered).not_to have_content '<br/>'
      expect(rendered).not_to have_content '</span>'
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
hyrax-1.1.1 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.1.0 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.5 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.4 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.3 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.2 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.1 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.0.rc2 spec/views/_flash_msg.html.erb_spec.rb
hyrax-1.0.0.rc1 spec/views/_flash_msg.html.erb_spec.rb
test_hyrax-0.0.1.alpha spec/views/_flash_msg.html.erb_spec.rb