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