Sha256: d2f94addda87ffc15b13f1ba9d836cc89365a5c41820a88a50e8ca283e5346c7

Contents?: true

Size: 830 Bytes

Versions: 13

Compression:

Stored size: 830 Bytes

Contents

require 'rails_helper'

module ConfigManager
	module Toggles
		describe Set, :redis => true do
			describe ".active?" do
				before { definition.type = 'set' }
				let(:definition) { Definition.new('ut') }

				context "when the challenge is in the set of acceptable answers" do
					before { definition.acceptable_values = %w(a b) }

					it "returns true" do
						Set.active?(definition, 'b').should be_truthy
					end
				end

				context "when the challenge is not in the set of acceptable answers" do
					before { definition.acceptable_values = %w(a b) }

					it "returns false" do
						Set.active?(definition, 'c').should be_falsy
					end
				end

				context "when there are no acceptable answers" do
					it "returns false" do
						Set.active?(definition, 'a').should be_falsy
					end
				end
			end
		end
	end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
config_manager-1.0.4 spec/lib/config_manager/toggles/set_spec.rb
config_manager-1.0.3 spec/lib/config_manager/toggles/set_spec.rb
config_manager-1.0.2 spec/lib/config_manager/toggles/set_spec.rb
config_manager-1.0.0 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.10 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.9 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.8 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.7 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.6 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.5 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.4 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.2 spec/lib/config_manager/toggles/set_spec.rb
config_manager-0.0.1 spec/lib/config_manager/toggles/set_spec.rb