Skip to content

Commit

Permalink
Set the system specs configuration option only for Solidus < 2.11
Browse files Browse the repository at this point in the history
From version 2.11 the systems specs option will be included.
PR: `solidusio/solidus#3552`
  • Loading branch information
blocknotes committed Apr 10, 2020
1 parent 62db46a commit 3d753a3
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require 'solidus_dev_support/rspec/feature_helper'
require 'spree/testing_support/caching'
require 'spree/testing_support/order_walkthrough'
require 'spree/testing_support/translations' unless Spree.solidus_gem_version < Gem::Version.new('2.11')

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand All @@ -24,7 +25,17 @@
config.infer_spec_type_from_file_location!
config.use_transactional_fixtures = false

config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
if Spree.solidus_gem_version < Gem::Version.new('2.11')
config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system

config.after(:each, type: :system) do |example|
missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
if missing_translations.any?
puts "Found missing translations: #{missing_translations.inspect}\n"
puts "In spec: #{example.location}"
end
end
end

config.before(:suite) do
if Spree::TestingSupport::Preferences.respond_to?(:freeze_preferences) # rubocop:disable Style/IfUnlessModifier
Expand All @@ -43,12 +54,4 @@
config.before(:each, type: :system, js: true) do
driven_by :apparition
end

config.after(:each, type: :system) do |example|
missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
if missing_translations.any?
puts "Found missing translations: #{missing_translations.inspect}"
puts "In spec: #{example.location}"
end
end
end

0 comments on commit 3d753a3

Please sign in to comment.