Sha256: b381a3ef9e34b30da6417e632d7292de64cf03e407b99f216a68e3fd34bb22ea

Contents?: true

Size: 713 Bytes

Versions: 42

Compression:

Stored size: 713 Bytes

Contents

require 'spec_helper'
require 'haml'

describe 'pugin/components/_header.html.haml', type: :view do
	context 'with global_search flag turned on' do
		before :each do
			allow(Pugin::Feature::GlobalSearch).to receive(:enabled?).and_return(true)
		end
		it 'renders as expected' do
      render
      expect(response).to eq(File.read(File.join(Rails.root, '../fixtures', '_header_with_search.html')))
    end
	end

	context 'without global_search flag turned on' do
		before :each do
			allow(Pugin::Feature::GlobalSearch).to receive(:enabled?).and_return(false)
		end
		it 'renders as expected' do
			render
			expect(response).to eq(File.read(File.join(Rails.root, '../fixtures', '_header.html')))
		end
	end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
pugin-1.10.10 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.9 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.8 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.7 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.6 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.5 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.4 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.3 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.2 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.1 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.10.0 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.7 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.6 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.5 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.4 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.3 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.2 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.1 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.9.0 spec/views/pugin/components/_header.html.haml_spec.rb
pugin-1.8.9 spec/views/pugin/components/_header.html.haml_spec.rb