Skip to content

Commit

Permalink
rename LD variation
Browse files Browse the repository at this point in the history
  • Loading branch information
mercedesb committed Mar 16, 2023
1 parent bf31f8b commit 3293a22
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/privacy_pass_supportable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def delete_privacy_pass_token_redemption

def privacy_pass_enabled?
ld_context = LaunchDarkly::LDContext.with_key(self.class.name)
Rails.configuration.launch_darkly_client.variation("privacy_pass.enabled", ld_context, false)
Rails.configuration.launch_darkly_client.variation("gemcutter.privacy_pass.enabled", ld_context, false)
end
end
6 changes: 3 additions & 3 deletions test/integration/sign_in_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class SignInTest < SystemTest
end

test "signing in when privacy pass is verified" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything, anything).returns(true).at_least_once
# privacy pass is meant to _not_ be machine automatable, so we're stubbing in this case
PrivacyPassRedeemer.expects(:call).with(anything, anything).returns(true)

Expand All @@ -349,7 +349,7 @@ class SignInTest < SystemTest
end

test "signing in when privacy pass is not verified and captcha is not triggered" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything, anything).returns(true).at_least_once
# privacy pass is meant to _not_ be machine automatable, so we're stubbing in this case
PrivacyPassRedeemer.expects(:call).with(anything, anything).returns(false)

Expand All @@ -362,7 +362,7 @@ class SignInTest < SystemTest
end

test "signing in when privacy pass is not verified and captcha is triggered" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything, anything).returns(true).at_least_once
@scope = Rack::Attack::LOGIN_THROTTLE_PER_USER_KEY
update_limit_for("#{@scope}:#{@user.email}", 4, Rack::Attack::LOGIN_LIMIT_PERIOD)
# captcha is meant to _not_ be machine automatable, so we're stubbing in this case
Expand Down
9 changes: 6 additions & 3 deletions test/integration/sign_up_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class SignUpTest < SystemTest
end

test "sign up when privacy pass is verified" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything,
anything).returns(true).at_least_once
# privacy pass is meant to _not_ be machine automatable, so we're stubbing in this case
PrivacyPassRedeemer.expects(:call).with(anything, anything).returns(true)

Expand All @@ -127,7 +128,8 @@ class SignUpTest < SystemTest
end

test "sign up when privacy pass is not verified and captcha is not triggered" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything,
anything).returns(true).at_least_once
# privacy pass is meant to _not_ be machine automatable, so we're stubbing in this case
PrivacyPassRedeemer.expects(:call).with(anything, anything).returns(false)

Expand All @@ -142,7 +144,8 @@ class SignUpTest < SystemTest
end

test "sign up when privacy pass is not verified and captcha verification is triggered" do
Rails.configuration.launch_darkly_client.expects(:variation).with("privacy_pass.enabled", anything, anything).returns(true).at_least_once
Rails.configuration.launch_darkly_client.expects(:variation).with("gemcutter.privacy_pass.enabled", anything,
anything).returns(true).at_least_once
# privacy pass is meant to _not_ be machine automatable, so we're stubbing in this case
PrivacyPassRedeemer.expects(:call).with(anything, anything).returns(false)

Expand Down

0 comments on commit 3293a22

Please sign in to comment.