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
  • Loading branch information
gsmendoza committed Mar 6, 2023
1 parent eda9e46 commit e4ed928
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
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 --git='https://github.com/solidusio/solidus_braintree' --branch='master'"
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 e4ed928

Please sign in to comment.