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

Relax Ruby version requirement; get CI passing #23

Open
wants to merge 9 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
11 changes: 9 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
version: 2.1

orbs:
# Browser tools are required for feature specs.
browser-tools: circleci/[email protected]

# Always take the latest version of the orb, this allows us to
# run specs against Solidus supported versions only without the need
# to change this configuration every time a Solidus version is released
Expand All @@ -9,11 +12,15 @@ orbs:

jobs:
run-specs-with-postgres:
executor: solidusio_extensions/postgres
executor:
name: solidusio_extensions/postgres
ruby_version: "3.0"
steps:
- solidusio_extensions/run-tests
run-specs-with-mysql:
executor: solidusio_extensions/mysql
executor:
name: solidusio_extensions/mysql
ruby_version: "3.0"
steps:
- solidusio_extensions/run-tests

Expand Down
22 changes: 13 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
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', 'main'

gem 'solidus', github: 'solidusio/solidus', branch: branch

# The `solidus_frontend` gem is deprecated and isn't expected to have major
# version updates after v3.2.
if branch >= 'v3.2'
gem 'solidus_frontend'
elsif branch == 'main'
gem 'solidus_frontend', github: 'solidusio/solidus_frontend', branch: branch
else
gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch
end

# Needed to help Bundler figure out how to resolve dependencies,
# otherwise it takes forever to resolve them.
Expand All @@ -31,7 +36,6 @@ end

group :test do
gem 'rails-controller-testing'
gem 'webdrivers'
end

gemspec
Expand Down
15 changes: 0 additions & 15 deletions app/overrides/add_recently_viewed_products.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- insert_after "#product_description[data-hook], [data-hook='product_description'], [data-hook='product_show']" -->

<%= render "spree/shared/add_recently_viewed_products" if Rails.env.test? %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!-- insert_after "#products[data-hook], [data-hook='products']" -->

<%= render "spree/shared/add_recently_viewed_products" if Rails.env.test? %>
9 changes: 3 additions & 6 deletions solidus_recently_viewed.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.summary = 'Adds recently viewed products to Spree'
s.description = s.summary

s.required_ruby_version = '~> 2.5'
s.required_ruby_version = '>= 2.5'

s.authors = ['Roman Smirnov', 'Brian Quinn', 'Allison Reilly']
s.email = '[email protected]'
Expand All @@ -31,11 +31,8 @@ Gem::Specification.new do |s|

s.add_dependency 'coffee-script'
s.add_dependency 'deface'
s.add_dependency 'sassc-rails'
s.add_dependency 'solidus_core', ['>= 2.4.0', '< 4']
s.add_dependency 'solidus_support', '~> 0.8'
s.add_dependency 'solidus_core', ['>= 2.4.0', '< 5']
s.add_dependency 'solidus_support'


s.add_development_dependency 'selenium-webdriver'
s.add_development_dependency 'solidus_dev_support'
end
24 changes: 17 additions & 7 deletions spec/features/recently_viewed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,23 @@

scenario 'keep track of recently viewed products', js: true do
visit spree.root_path
click_link 'Mug'
click_link 'Home'
click_link 'Jersey'
click_link 'Home'
within(:css, 'ul#recently_viewed_products') do
expect(page).to have_text 'Mug'
expect(page).to have_text 'Jersey'

click_link "Mug"
within "h1.product-title" do
expect(page).to have_text "Mug"
end

click_link "Home"

click_link "Jersey"
within "h1.product-title" do
expect(page).to have_text "Jersey"
end

click_link "Home"
within(:css, "ul#recently_viewed_products") do
expect(page).to have_text "Mug"
expect(page).to have_text "Jersey"
end
end
end
5 changes: 0 additions & 5 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,4 @@
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.use_transactional_fixtures = false
if defined?(ActiveStorage::Current)
config.before(:all) do
ActiveStorage::Current.host = 'https://www.example.com'
end
end
end