Sha256: ded01d67d01ec350827d6bf79ff3af3d66eefa7445a75a859f3201298101fa47

Contents?: true

Size: 1.38 KB

Versions: 5

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'
require 'haml'

describe 'pugin/components/_navigation-main.html.haml', type: :view do

	before :each do
		module Parliament
			module Utils
				module Helpers
					module HousesHelper
					end
				end
			end
		end
		# Parliament::Utils::Helpers::HousesHelper = Class.new
  	allow(Parliament::Utils::Helpers::HousesHelper).to receive(:commons_id).and_return('123')
  	allow(Parliament::Utils::Helpers::HousesHelper).to receive(:lords_id).and_return('456')
		allow(view).to receive(:mps_path).and_return("/mps")
		allow(view).to receive(:house_members_current_a_z_letter_path).and_return("houses/#{Parliament::Utils::Helpers::HousesHelper.lords_id}/members/current/a-z/a")
		allow(view).to receive(:constituencies_current_a_z_letter_path).and_return("constituencies/current/a-z/a")
		allow(view).to receive(:house_parties_current_path).and_return("houses/#{Parliament::Utils::Helpers::HousesHelper.commons_id}/parties/current/")
	end

	it 'renders correctly' do
		render
		expect(rendered).to include("<nav aria-label='navigation' class='navigation--main'>")
		expect(rendered).to include('<a href="/mps">MPs</a>')
		expect(rendered).to include('<a href="houses/456/members/current/a-z/a">Lords</a>')
		expect(rendered).to include('<a href="constituencies/current/a-z/a">Constituencies</a>')
		expect(rendered).to include('<a href="houses/123/parties/current/">Parties and groups</a>')
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pugin-1.2.1 spec/views/pugin/components/_navigation-main.html.haml_spec.rb
pugin-1.2.0 spec/views/pugin/components/_navigation-main.html.haml_spec.rb
pugin-1.1.2 spec/views/pugin/components/_navigation-main.html.haml_spec.rb
pugin-1.0.1 spec/views/pugin/components/_navigation-main.html.haml_spec.rb
pugin-1.0.0.pre spec/views/pugin/components/_navigation-main.html.haml_spec.rb