# USAGE
# Given the active variant for <feature_name> is <enabled|control> for an <ALW|OA> user
Given(/^the active variant for (.*) is (.*) for an (.*) user$/) do |feature, variant, user|
  res = case user
        when "ALW"
          update_feature_flag(feature, variant, ALW_USER_ID)
        when "OA"
          update_feature_flag(feature, variant, OA_USER_ID)
        else
          fail "unknown user type: #{user}"
        end

  assert_equal(200, res[:code], res[:response])
  assert_equal({ feature => variant }, JSON.parse(res[:response]))
end
