Skip to content
Merged
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
67 changes: 0 additions & 67 deletions .circleci/config.yml

This file was deleted.

70 changes: 70 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test

on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * 4" # every Thursday

concurrency:
group: test-${{ github.ref_name }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

permissions:
contents: read

jobs:
rspec:
name: Solidus ${{ matrix.solidus-branch }}, Rails ${{ matrix.rails-version }} and Ruby ${{ matrix.ruby-version }} on ${{ matrix.database }}
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
rails-version:
- "7.0"
- "7.1"
- "7.2"
ruby-version:
- "3.1"
- "3.4"
solidus-branch:
- "v4.1"
- "v4.2"
- "v4.3"
- "v4.4"
database:
- "postgresql"
- "mysql"
- "sqlite"
exclude:
- rails-version: "7.2"
solidus-branch: "v4.3"
- rails-version: "7.2"
solidus-branch: "v4.2"
- rails-version: "7.2"
solidus-branch: "v4.1"
- rails-version: "7.1"
solidus-branch: "v4.2"
- rails-version: "7.1"
solidus-branch: "v4.1"
- ruby-version: "3.4"
rails-version: "7.0"
env:
TEST_RESULTS_PATH: coverage/coverage.xml
steps:
- uses: actions/checkout@v4
- name: Run extension tests
uses: solidusio/test-solidus-extension@main
with:
database: ${{ matrix.database }}
rails-version: ${{ matrix.rails-version }}
ruby-version: ${{ matrix.ruby-version }}
solidus-branch: ${{ matrix.solidus-branch }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.TEST_RESULTS_PATH }}
30 changes: 8 additions & 22 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,26 @@ branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
gem 'solidus', github: 'solidusio/solidus', branch: branch

# The solidus_frontend gem has been pulled out since v3.2
if branch >= 'v3.2'
gem 'solidus_frontend'
elsif branch == 'main'
gem 'solidus_frontend', github: 'solidusio/solidus_frontend'
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.
# See https://github.com/bundler/bundler/issues/6677
gem 'rails', '>0.a'
gem 'solidus_frontend'

# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'
rails_version = ENV.fetch('RAILS_VERSION', '7.2')
gem 'rails', "~> #{rails_version}"

case ENV['DB']
when 'mysql'
gem 'mysql2'
when 'postgresql'
gem 'pg'
else
gem 'sqlite3'
if rails_version <= "7.2"
gem 'sqlite3', "~> 1.7"
else
gem 'sqlite3', "~> 2.0"
end
end

gemspec

if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3')
# Fix for Rails 7+ / Ruby 3+, see https://stackoverflow.com/a/72474475
gem 'net-imap', require: false
gem 'net-pop', require: false
gem 'net-smtp', require: false
end

# Use a local Gemfile to include development dependencies that might not be
# relevant for the project or for other contributors, e.g. pry-byebug.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def self.prepended(base)
end

def subscriptions_attributes=(params)
::Spree::Deprecation.warn(
'Creating or updating subscriptions through Spree::User nested attributes is deprecated. ' \
::Spree.deprecator.warn(
"Creating or updating subscriptions through #{::Spree.user_class} nested attributes is deprecated. " \
'Please use subscriptions APIs directly.'
)
super
Expand All @@ -27,4 +27,4 @@ def subscriptions_attributes=(params)
end
end

Spree.user_class.prepend(SolidusSubscriptions::Spree::User::HaveManySubscriptions)
::Spree.user_class.prepend(SolidusSubscriptions::Spree::User::HaveManySubscriptions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def add_javascripts

def copy_starter_frontend_files
return if options[:frontend] != 'starter'
return unless File.exist?(Rails.root.join('app/views/cart_line_items/_product_submit.html.erb'))

copy_file 'app/views/cart_line_items/_subscription_fields.html.erb'
prepend_to_file 'app/views/cart_line_items/_product_submit.html.erb', "<%= render 'cart_line_items/subscription_fields' %>\n"
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/spree/api/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

it 'updates the subscription line items' do
allow(::Spree::Deprecation).to receive(:warn).with(a_string_matching(
'Creating or updating subscriptions through Spree::User nested attributes is deprecated'
"Creating or updating subscriptions through #{Spree.user_class} nested attributes is deprecated"
))
update_user
line_item = subscription.line_items.reload.first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'spec_helper'

RSpec.describe SolidusSubscriptions::Spree::User::HaveManySubscriptions, type: :model do
subject(:user) { Spree::User.new }
subject(:user) { Spree.user_class.new }

it { is_expected.to have_many :subscriptions }
it { is_expected.to accept_nested_attributes_for :subscriptions }
Expand All @@ -16,7 +16,7 @@

expect(::Spree::Deprecation)
.to have_received(:warn)
.with(/Creating or updating subscriptions through Spree::User nested attributes is deprecated/)
.with(/Creating or updating subscriptions through #{Spree.user_class} nested attributes is deprecated/)
end
end
end
Loading