Skip to content

Commit

Permalink
Add Braintree to the installer as a payment method option
Browse files Browse the repository at this point in the history
Closes #4749.
  • Loading branch information
gsmendoza authored and kennyadsl committed Mar 29, 2023
1 parent eda9e46 commit 4df1ae7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
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鈥檒l 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
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

0 comments on commit 4df1ae7

Please sign in to comment.