Skip to content

Commit c0a7fb2

Browse files
kennyadslelia
authored andcommitted
Fix specs with the latest version of Solidus
1. There's no more a frontend 2. Something changed in how images are saved and now they require access to the database, we can't use build_stubbed anymore in variant specs 3. some taxon/taxonomy validations was failing due to solidusio/solidus#4851
1 parent df625b8 commit c0a7fb2

File tree

7 files changed

+6
-23
lines changed

7 files changed

+6
-23
lines changed

Gemfile

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,7 @@ source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

66
branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
7-
solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2')
8-
%w[solidusio/solidus solidusio/solidus_frontend]
9-
else
10-
%w[solidusio/solidus] * 2
11-
end
12-
gem 'solidus', github: solidus_git, branch: branch
13-
gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
14-
15-
# Needed to help Bundler figure out how to resolve dependencies,
16-
# otherwise it takes forever to resolve them.
17-
# See https://github.com/bundler/bundler/issues/6677
18-
gem 'rails', '>0.a'
7+
gem 'solidus', github: 'solidusio/solidus', branch: branch
198

209
# Provides basic authentication functionality for testing parts of your engine
2110
gem 'solidus_auth_devise'

app/assets/javascripts/spree/frontend/solidus_importer.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

app/assets/stylesheets/spree/frontend/solidus_importer.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/generators/solidus_importer/install/install_generator.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ def copy_initializer
1111
end
1212

1313
def add_javascripts
14-
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_importer\n"
1514
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/solidus_importer\n"
1615
end
1716

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

lib/solidus_importer/processors/taxon.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ def add_taxon(taxon)
4242
def prepare_taxon(name, taxonomy)
4343
Spree::Taxon.find_or_initialize_by(
4444
name: name,
45-
taxonomy_id: taxonomy.id
46-
)
45+
taxonomy_id: taxonomy.id,
46+
parent: taxonomy.root
47+
).tap(&:validate!)
4748
end
4849

4950
def tags

spec/lib/solidus_importer/processors/variant_images_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
let(:context) do
3333
{
3434
data: { 'Variant Image' => 'http://remote-service.net/thinking-cat.jpg' },
35-
variant: build_stubbed(:variant)
35+
variant: create(:variant)
3636
}
3737
end
3838
let(:uri) do

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Configure Rails Environment
44
ENV['RAILS_ENV'] = 'test'
5+
ENV['FRONTEND'] = 'none'
56

67
# Run Coverage report
78
require 'solidus_dev_support/rspec/coverage'

0 commit comments

Comments
 (0)