Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Braintree to the installer as a payment method option #4961

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add Braintree to the installer as a payment method option
Closes #4749.
  • Loading branch information
gsmendoza authored and kennyadsl committed Mar 29, 2023
commit 3b9d19632404926cff79b6046649fc59f3d46880
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ jobs:
cd /tmp/my_app
bundle list | grep 'solidus_paypal_commerce_platform (1.'

- install_solidus: { flags: "--sample=false --frontend=starter --payment-method=braintree" }
- test_page: { expected_text: "The only eCommerce platform you’ll ever need." }
- run:
name: Ensure the correct Braintree is installed for SSF
command: |
cd /tmp/my_app
bundle list | grep 'solidus_braintree (3.'

- install_solidus: { flags: "--sample=false --frontend=none --authentication=none" }
- test_page: { expected_text: "<title>Ruby on Rails" }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
unless Bundler.locked_gems.dependencies['solidus_braintree']
bundle_command 'add solidus_braintree --version "~> 3.0"'
end

generate 'solidus_braintree:install'
6 changes: 6 additions & 0 deletions core/lib/generators/solidus/install/install_generator.rb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a much needed cleanup! 🙌
It should be applied equally to all enum options like payment

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ class InstallGenerator < Rails::Generators::AppBase
description: 'Install `solidus_bolt`',
default: false,
},
{
name: 'braintree',
frontends: %w[none starter],
description: 'Install `solidus_braintree`',
default: false,
},
{
name: 'none',
frontends: %w[none classic starter],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
expect(questions.first[:default]).to eq('paypal')
expect(strip_ansi questions.first[:desc]).to include('[paypal]')
expect(strip_ansi questions.first[:desc]).to include('[bolt]')
expect(strip_ansi questions.first[:desc]).to_not include('[braintree]')
expect(strip_ansi questions.first[:desc]).to include('[none]')
end

Expand All @@ -121,10 +122,11 @@
generator.prepare_options

expect(questions.size).to eq(1)
expect(questions.first[:limited_to]).to eq(['paypal', 'none'])
expect(questions.first[:limited_to]).to eq(['paypal', 'braintree', 'none'])
expect(questions.first[:default]).to eq('paypal')
expect(strip_ansi questions.first[:desc]).to include('[paypal]')
expect(strip_ansi questions.first[:desc]).not_to include('[bolt]')
expect(strip_ansi questions.first[:desc]).to include('[braintree]')
expect(strip_ansi questions.first[:desc]).to include('[none]')
end
end
Expand Down