Sha256: cabb00b3da5e4f378e014d77a101a36f3da8a498b445013ca2c7522731d03501

Contents?: true

Size: 1.56 KB

Versions: 7

Compression:

Stored size: 1.56 KB

Contents

require 'spec_helper'
require 'pugin/helpers/controller_helpers'

describe 'pugin/helpers/controller_helpers.rb' do 

	before do 
		class TestClass
			include Pugin::Helpers::ControllerHelpers
		end 
	end

	subject { TestClass.new }

	context '#enable_status_banner' do 
		it 'enables the status banner' do 
			subject.enable_status_banner
			expect(Pugin::Feature::TopNavigation.enabled?).to equal(true)
		end
	end
	context '#disable_status_banner' do 

		before :each do 
			Pugin::Feature::StatusBanner.enable
		end

		it 'disables the status banner' do 
			expect(Pugin::Feature::StatusBanner.disabled?).to equal(false)
			subject.disable_status_banner
			expect(Pugin::Feature::StatusBanner.disabled?).to equal(true)
		end
	end
	context '#enable_top_navigation' do 
		it 'enables the top navigation' do 
			subject.enable_top_navigation
			expect(Pugin::Feature::TopNavigation.enabled?).to equal(true)
		end
	end
	context '#disable_top_navigation' do 

		before :each do 
			Pugin::Feature::TopNavigation.enable
		end

		it 'disables the top navigation' do 
			expect(Pugin::Feature::TopNavigation.disabled?).to equal(false)
			subject.disable_top_navigation
			expect(Pugin::Feature::TopNavigation.disabled?).to equal(true)
		end
	end
	context '#reset_bandiera_features' do 
		before :each do
			Pugin::Feature::Bandiera.instance_variable_set(:@features, {'show-register' => true, 'show-dissolution' => true})
		end

		it 'resets @features back to nil' do
			subject.reset_bandiera_features
			expect(Pugin::Feature::Bandiera.instance_variable_get(:@features)).to equal(nil)
		end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pugin-1.2.3 spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.2.2 spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.2.1 spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.2.0 spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.1.2 spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.0.1.pre spec/lib/pugin/helpers/controller_helpers_spec.rb
pugin-1.0.1 spec/lib/pugin/helpers/controller_helpers_spec.rb