Skip to content

Commit

Permalink
Merge pull request #29 from aitbw/aitbw/spec_suite_maintenance
Browse files Browse the repository at this point in the history
Spec suite maintenance
  • Loading branch information
kennyadsl authored Jan 2, 2019
2 parents b3d1220 + 7813815 commit bd005d2
Show file tree
Hide file tree
Showing 12 changed files with 248 additions and 836 deletions.
17 changes: 9 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
source 'https://rubygems.org'

branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
gem 'solidus', github: 'solidusio/solidus', branch: branch
gem 'solidus', git: 'https://github.com/solidusio/solidus.git', branch: branch
gem 'solidus_auth_devise'

if branch == 'master' || branch >= "v2.3"
gem 'rails', '~> 5.1.0' # hack for broken bundler dependency resolution
elsif branch >= "v2.0"
gem 'rails', '~> 5.0.0' # hack for broken bundler dependency resolution
if branch < 'v2.5'
gem 'factory_bot', '4.10.0'
else
gem "rails", '~> 4.2.0' # hack for broken bundler dependency resolution
gem 'factory_bot', '> 4.10.0'
end

gem 'pg'
gem 'mysql2'
if ENV['DB'] == 'mysql'
gem 'mysql2', '~> 0.4.10'
else
gem 'pg', '~> 0.21'
end

gemspec
4 changes: 2 additions & 2 deletions app/models/solidus_easypost/estimator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def shipping_rates(package, frontend_only = true)
shipping_method: find_or_create_shipping_method(rate)
)

shipping_rates << spree_rate if spree_rate.shipping_method.frontend?
shipping_rates << spree_rate if spree_rate.shipping_method.available_to_users?
end

# Sets cheapest rate to be selected by default
Expand All @@ -39,7 +39,7 @@ def find_or_create_shipping_method(rate)
method_name = "#{ rate.carrier } #{ rate.service }"
Spree::ShippingMethod.find_or_create_by(admin_name: method_name) do |r|
r.name = method_name
r.display_on = 'back_end'
r.available_to_users = false
r.code = rate.service
r.calculator = Spree::Calculator::Shipping::FlatRate.create
r.shipping_categories = [Spree::ShippingCategory.first]
Expand Down
4 changes: 2 additions & 2 deletions lib/spree_easypost/factories.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FactoryGirl.define do
FactoryBot.define do
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
#
# Example adding this to your spec_helper will load these Factories for use:
# require 'spree_easypost/factories'
end

FactoryGirl.modify do
FactoryBot.modify do
factory :address do
lastname "Doe"
end
Expand Down
2 changes: 1 addition & 1 deletion solidus_easypost.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Gem::Specification.new do |s|
s.add_dependency 'solidus', ['>= 1.1', '< 3.x']
s.add_dependency 'solidus_support', '>= 0.1.1'
s.add_dependency 'easypost'
s.add_dependency "deface", '~> 1.0'

s.add_development_dependency 'capybara', '~> 2.1'
s.add_development_dependency 'coffee-rails'
s.add_development_dependency 'database_cleaner'
s.add_development_dependency 'factory_girl', '~> 4.4'
s.add_development_dependency 'ffaker'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'sass-rails'
Expand Down
Loading

0 comments on commit bd005d2

Please sign in to comment.