Skip to content
代码片段 群组 项目
提交 360ea615 编辑于 作者: Drew Blessing's avatar Drew Blessing
浏览文件

Merge branch 'jswain_identity_verification_add_actor_to_flags' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -87,10 +87,14 @@ def email_verified?
end
def credit_card_verification_enabled?
Feature.enabled?(:identity_verification_credit_card)
return false unless is_a?(User)
Feature.enabled?(:identity_verification_credit_card, self)
end
def phone_number_verification_enabled?
Feature.enabled?(:identity_verification_phone_number)
return false unless is_a?(User)
Feature.enabled?(:identity_verification_phone_number, self)
end
end
......@@ -139,7 +139,7 @@
expect(page).to have_current_path(success_identity_verification_path)
stub_feature_flags(identity_verification_credit_card: true)
stub_feature_flags(identity_verification_credit_card: user)
sign_out(user)
......
......@@ -92,6 +92,35 @@ def add_user_risk_band(value)
it { is_expected.to eq(result) }
end
context 'when flag is enabled for a specific user' do
let_it_be(:another_user) { create(:user) }
where(:risk_band, :credit_card, :phone_number, :result) do
'High' | true | false | %w[credit_card email]
'Medium' | false | true | %w[phone email]
end
with_them do
before do
stub_feature_flags(
identity_verification_phone_number: false,
identity_verification_credit_card: false
)
add_user_risk_band(risk_band)
create(:user_custom_attribute, key: 'arkose_risk_band', value: risk_band, user: another_user)
stub_feature_flags(identity_verification_phone_number: user) if phone_number
stub_feature_flags(identity_verification_credit_card: user) if credit_card
end
it 'only affects that user' do
expect(user.required_identity_verification_methods).to eq(result)
expect(another_user.required_identity_verification_methods).to eq(%w[email])
end
end
end
end
describe('#identity_verification_state') do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册