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

Fix specs with the latest version of Solidus #94

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 9 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ jobs:
run-specs-with-postgres:
executor: solidusio_extensions/postgres
steps:
- solidusio_extensions/run-tests
run-specs-with-mysql:
executor: solidusio_extensions/mysql
steps:
- solidusio_extensions/run-tests
- checkout
- solidusio_extensions/dependencies
- run:
name: "Run specs on the legacy frontend"
command: export FRONTEND=solidus_frontend
- solidusio_extensions/test-branch:
branch: v3.3
rails_version: '~> 7.0'
- solidusio_extensions/store-test-results
lint-code:
executor: solidusio_extensions/sqlite-memory
steps:
Expand All @@ -25,7 +29,6 @@ workflows:
"Run specs on supported Solidus versions":
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
- lint-code

"Weekly run specs against master":
Expand All @@ -38,4 +41,3 @@ workflows:
- master
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
11 changes: 3 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2')
%w[solidusio/solidus solidusio/solidus_frontend]
else
%w[solidusio/solidus] * 2
end
gem 'solidus', github: solidus_git, branch: branch
gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
branch = ENV.fetch('SOLIDUS_BRANCH', 'v3.3')
gem 'solidus', git: "https://github.com/solidusio/solidus.git", branch: branch
gem 'solidus_frontend', git: "https://github.com/solidusio/solidus_frontend.git", branch: branch

# Needed to help Bundler figure out how to resolve dependencies,
# otherwise it takes forever to resolve them.
Expand Down
2 changes: 0 additions & 2 deletions app/assets/javascripts/spree/frontend/solidus_importer.js

This file was deleted.

4 changes: 0 additions & 4 deletions app/assets/stylesheets/spree/frontend/solidus_importer.css

This file was deleted.

2 changes: 0 additions & 2 deletions lib/generators/solidus_importer/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ def copy_initializer
end

def add_javascripts
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_importer\n"
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/solidus_importer\n"
end

def add_stylesheets
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/solidus_importer\n", before: %r{\*/}, verbose: true # rubocop:disable Layout/LineLength
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/solidus_importer\n", before: %r{\*/}, verbose: true # rubocop:disable Layout/LineLength
end

Expand Down
5 changes: 3 additions & 2 deletions lib/solidus_importer/processors/taxon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ def add_taxon(taxon)
def prepare_taxon(name, taxonomy)
Spree::Taxon.find_or_initialize_by(
name: name,
taxonomy_id: taxonomy.id
)
taxonomy_id: taxonomy.id,
parent: taxonomy.root
).tap(&:validate!)
end

def tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
let(:context) do
{
data: { 'Variant Image' => 'http://remote-service.net/thinking-cat.jpg' },
variant: build_stubbed(:variant)
variant: create(:variant)
}
end
let(:uri) do
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# Configure Rails Environment
ENV['RAILS_ENV'] = 'test'
ENV['FRONTEND'] = 'none'

# Run Coverage report
require 'solidus_dev_support/rspec/coverage'
Expand Down