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 1127f81 commit f9657fb
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@
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}\nIn 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 +52,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 f9657fb

Please sign in to comment.