Compare commits

...

27 Commits

Author SHA1 Message Date
David Cook
59547ba9e4 Merge pull request #13964 from mkllnk/flaky-spec
Stabilise actions_spec
2026-03-04 13:06:08 +11:00
Maikel
9fb8bb15e8 Merge pull request #13951 from zilton7/fix/spree-credit-card-brand-deprecation
Fix Spree::CreditCard#brand= deprecation for Rails 7.2 compatibility
2026-03-04 11:01:10 +11:00
Maikel
8aa89c0bf7 Merge pull request #13669 from pacodelaluna/repair-proxy-order-to-support-order-cycle-without-closing-time
Repair ProxyOrder to support order cycle without closing time
2026-03-04 10:59:21 +11:00
Maikel
7a4beb8b22 Merge pull request #13982 from openfoodfoundation/dependabot/npm_and_yarn/tom-select-2.5.2
Bump tom-select from 2.5.1 to 2.5.2
2026-03-04 09:49:28 +11:00
Maikel
9a48ee16cc Merge pull request #13983 from openfoodfoundation/dependabot/npm_and_yarn/hotkeys-js-4.0.1
Bump hotkeys-js from 4.0.0 to 4.0.1
2026-03-04 09:48:23 +11:00
Maikel
50c0e8af7d Merge pull request #13984 from openfoodfoundation/dependabot/bundler/pdf-reader-2.15.1
Bump pdf-reader from 2.15.0 to 2.15.1
2026-03-04 09:47:35 +11:00
David Cook
1cf2928f9f Merge pull request #13979 from openfoodfoundation/RachL-patch-1
Update release issue template
2026-03-04 09:10:24 +11:00
François Turbelin
6cacde837d Remove duplicated test 2026-03-03 14:27:20 +01:00
dependabot[bot]
1d2d661675 Bump pdf-reader from 2.15.0 to 2.15.1
Bumps [pdf-reader](https://github.com/yob/pdf-reader) from 2.15.0 to 2.15.1.
- [Changelog](https://github.com/yob/pdf-reader/blob/main/CHANGELOG)
- [Commits](https://github.com/yob/pdf-reader/compare/v2.15.0...v2.15.1)

---
updated-dependencies:
- dependency-name: pdf-reader
  dependency-version: 2.15.1
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 09:33:47 +00:00
dependabot[bot]
5029c03205 Bump hotkeys-js from 4.0.0 to 4.0.1
Bumps [hotkeys-js](https://github.com/jaywcjlove/hotkeys-js) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/jaywcjlove/hotkeys-js/releases)
- [Commits](https://github.com/jaywcjlove/hotkeys-js/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: hotkeys-js
  dependency-version: 4.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 09:33:32 +00:00
dependabot[bot]
2b648f3f3c Bump tom-select from 2.5.1 to 2.5.2
Bumps [tom-select](https://github.com/orchidjs/tom-select) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/orchidjs/tom-select/releases)
- [Commits](https://github.com/orchidjs/tom-select/compare/v2.5.1...2.5.2)

---
updated-dependencies:
- dependency-name: tom-select
  dependency-version: 2.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 09:33:16 +00:00
Maikel Linke
4873fd3275 Remove non-task item 2026-03-03 16:16:57 +11:00
Maikel Linke
e0ad4363a9 Fix formatting 2026-03-03 16:12:47 +11:00
François Turbelin
7010cda9f7 Tidy up the tests 2026-03-02 22:07:45 +01:00
Rachel Arnould
70b2a6d999 Update release template
Currently testers are using google docs to store release tests. This is maybe overkill.

I've documented the steps here and the proposal is for testers to document their test in the release issue.
2026-03-02 12:22:11 +01:00
François Turbelin
28dde86960 Repair ProxyOrder to support order cycle without closing time 2026-02-27 14:36:20 +01:00
Zil Norvilis
9488e9b459 feat: display credit card brand instead of card type in the saved cards list. 2026-02-26 15:52:45 +02:00
Zil Norvilis
503429960a Reverse credit_card_serializer changes 2026-02-26 15:10:21 +02:00
Maikel Linke
fd178ee80b Use unique categories to avoid flakiness 2026-02-26 11:42:46 +11:00
Maikel Linke
e4db20f86e Remove unncessary expectation
This assertion was confusing me. It was quite complex and the only thing
it was asserting was the placeholder via a CSS selector. I don't think
it's worth keeping.
2026-02-26 11:37:30 +11:00
Zil Norvilis
58520a0c4c test: Add specs for the stripe_card_options helper method, verifying card formatting and month padding. 2026-02-25 19:49:10 +02:00
Zil Norvilis
0bc4b1c885 refactor: Standardize credit card type attribute to cc_type across the application, removing the brand alias and related methods. 2026-02-25 19:35:53 +02:00
Maikel Linke
560348722c Revert "Test current flakiness of spec"
This reverts commit 7b715bf6c7.
2026-02-25 15:18:39 +11:00
Maikel Linke
6d17cf50fb Test impact of longer wait time on flakiness 2026-02-25 15:08:50 +11:00
Maikel Linke
7b715bf6c7 Test current flakiness of spec 2026-02-25 15:07:52 +11:00
Zil Norvilis
2cfd386ad7 test: add spec for Spree::CreditCard#brand= setter to verify card type reformatting 2026-02-22 22:28:40 +02:00
Zil Norvilis
ce94b394b2 feat: Add brand= setter to Spree::CreditCard for cc_type assignment. 2026-02-22 22:01:54 +02:00
11 changed files with 107 additions and 39 deletions

View File

@@ -27,7 +27,12 @@ assignees: ''
- [ ] Move this issue to Test Ready.
- [ ] Notify `@testers` in [#testing].
- [ ] Test build: [Deploy to Staging] with release tag.
- [ ] Notify a deployer to deploy it
- [ ] Map is displayed correctly. Address changes are reflected in the map.
- [ ] Stripe with no authentication card: `4242424242424242` as shopper and as Admin. Order confirmation displays order as "Paid".
- [ ] Stripe with Authentication required card: `4000002760003184` as shopper and as Admin. As admin, check authorization through customer account `/account#/transactions` and email.
- [ ] Pay with Paypal.
- [ ] Order on mobile.
- [ ] Notify a deployer to deploy it.
## 3. Deployment at beginning of week
@@ -57,4 +62,4 @@ The full process is described at https://github.com/openfoodfoundation/openfoodn
[Create issue]: https://github.com/openfoodfoundation/openfoodnetwork/issues/new?assignees=&labels=&projects=&template=release.md&title=Release
[#delivery-circle]: https://openfoodnetwork.slack.com/archives/C01T75H6G0Z
[Transifex Client]: https://developers.transifex.com/docs/cli
[minor or major breaking changes]: https://github.com/openfoodfoundation/openfoodnetwork/pulls?q=label%3A%22breaking+change%22%2C%22major+breaking+change%22
[minor or major breaking changes]: https://github.com/openfoodfoundation/openfoodnetwork/pulls?q=label%3A%22breaking+change%22%2C%22major+breaking+change%22

View File

@@ -170,7 +170,7 @@ GEM
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
aes_key_wrap (1.1.0)
afm (0.2.2)
afm (1.0.0)
angular-rails-templates (1.4.0)
railties (>= 5.0, < 8.2)
sprockets (>= 3.0, < 5)
@@ -584,7 +584,7 @@ GEM
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.15.0)
pdf-reader (2.15.1)
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
afm (>= 0.2.1, < 2)
hashery (~> 2.0)

View File

@@ -139,7 +139,7 @@ module CheckoutHelper
def stripe_card_options(cards)
cards.map do |cc|
[
"#{cc.brand} #{cc.last_digits} #{I18n.t(:card_expiry_abbreviation)}:" \
"#{cc.cc_type} #{cc.last_digits} #{I18n.t(:card_expiry_abbreviation)}:" \
"#{cc.month.to_s.rjust(2, '0')}/#{cc.year}", cc.id
]
end

View File

@@ -76,6 +76,7 @@ class ProxyOrder < ApplicationRecord
def cart?
order&.state == 'complete' &&
order_cycle.orders_close_at.present? &&
order_cycle.orders_close_at > Time.zone.now
end

View File

@@ -25,9 +25,6 @@ module Spree
scope :with_payment_profile, -> { where.not(gateway_customer_profile_id: nil) }
# needed for some of the ActiveMerchant gateways (eg. SagePay)
alias_attribute :brand, :cc_type
def expiry=(expiry)
self[:month], self[:year] = expiry.split(" / ")
self[:year] = "20#{self[:year]}"

View File

@@ -52,9 +52,9 @@ module Spree
def supports?(source)
return true unless provider_class.respond_to? :supports?
return false unless source.brand
return false unless source.cc_type
provider_class.supports?(source.brand)
provider_class.supports?(source.cc_type)
end
end
end

View File

@@ -193,4 +193,25 @@ RSpec.describe CheckoutHelper do
end
end
end
describe "#stripe_card_options" do
let(:year) { Time.zone.now.year + 1 }
let(:card) { create(:credit_card, cc_type: 'visa', last_digits: '1111', month: 1, year:) }
let(:cards) { [card] }
it "formats credit cards for Stripe options" do
options = helper.stripe_card_options(cards)
expect(options).to eq([
["visa 1111 Exp:01/#{year}", card.id]
])
end
it "zero-pads the month" do
card.update(month: 5)
options = helper.stripe_card_options(cards)
expect(options.first.first).to match(%r{05/#{year}})
end
end
end

View File

@@ -206,6 +206,69 @@ RSpec.describe ProxyOrder do
end
end
describe "#state" do
subject(:proxy_order) { build(:proxy_order, subscription:, order:, order_cycle:) }
let(:order) { build(:order) }
let(:subscription) { build(:subscription) }
let(:order_cycle) { build(:simple_order_cycle) }
context "when the proxy order is canceled" do
it "returns 'canceled'" do
proxy_order.canceled_at = Time.zone.now
expect(proxy_order.state).to eq('canceled')
end
end
context "when the order is not present" do
let(:order) { nil }
it "returns 'pending'" do
expect(proxy_order.state).to eq('pending')
end
context "when the subscription is paused" do
it "returns 'paused'" do
subscription.paused_at = Time.zone.now
expect(proxy_order.state).to eq('paused')
end
end
end
context "when the order cycle is not yet open" do
let(:order_cycle) { build(:order_cycle, orders_open_at: 2.days.from_now) }
it "returns 'pending'" do
expect(proxy_order.state).to eq('pending')
end
end
context "when the order is complete" do
let(:order) { build(:completed_order_with_totals) }
context "when the order cycle is already closed" do
it "returns 'complete'" do
order_cycle.orders_close_at = 2.days.ago
expect(proxy_order.state).to eq('complete')
end
end
context "when the order cycle is still open" do
it "returns 'cart'" do
order_cycle.orders_close_at = 2.days.from_now
expect(proxy_order.state).to eq('cart')
end
end
context "when the order cycle does not have a closing date" do
it "returns 'complete'" do
order_cycle.orders_close_at = nil
expect(proxy_order.state).to eq('complete')
end
end
end
end
private
def expect_cancelled_now(subject)

View File

@@ -79,12 +79,6 @@ module ProductsHelper
end
end
def validate_tomselect_with_search!(page, field_name, search_selector)
open_tomselect_to_validate!(page, field_name) do
expect(page).to have_selector(search_selector)
end
end
def random_producer(product)
Enterprise.is_primary_producer
.where.not(id: product.supplier.id)

View File

@@ -167,7 +167,10 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
before do
create_list(:supplier_enterprise, 11, users: [user])
create_list(:tax_category, 11)
create_list(:taxon, 11)
build_list(:taxon, 11).each_with_index do |taxon, i|
taxon.name += " #{i}"
taxon.save!
end
visit admin_products_url
end
@@ -178,24 +181,8 @@ RSpec.describe 'As an enterprise user, I can manage my products' do
tax_category_to_select = random_tax_category
within row_containing_name(variant_a1.display_name) do
validate_tomselect_with_search!(
page, "Producer",
producer_search_selector
)
tomselect_search_and_select(producer_to_select, from: "Producer")
sleep(0.1)
validate_tomselect_with_search!(
page, "Category",
categories_search_selector
)
tomselect_search_and_select(category_to_select, from: "Category")
sleep(0.1)
validate_tomselect_with_search!(
page, "Tax Category",
tax_categories_search_selector
)
tomselect_search_and_select(tax_category_to_select, from: "Tax Category")
end

View File

@@ -4005,9 +4005,9 @@ hasown@^2.0.2:
function-bind "^1.1.2"
hotkeys-js@*:
version "4.0.0"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-4.0.0.tgz#75336c0ac610ad384d286c61c519909dcd4bdf6b"
integrity sha512-gIoeqMWYqPIItc4HaseVbtTRpEpBbeufZMUcoWtN62JZdDq3KadS1ijN6wpaDjTzRK7PjT3QOPUcx+yNT0rrZQ==
version "4.0.1"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-4.0.1.tgz#d30f61568df248e22be864b6b86d22540438d0f6"
integrity sha512-zjh2YxGhTMbddFUxyMOc35Iq0v86N7JnsB62m4hm34fG/CVX1ard7Gp3AJN4PK9lSLFexK14zPMNVwSYgz3tRg==
hpack.js@^2.1.6:
version "2.1.6"
@@ -7064,9 +7064,9 @@ toidentifier@1.0.1, toidentifier@~1.0.1:
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
tom-select@*:
version "2.5.1"
resolved "https://registry.yarnpkg.com/tom-select/-/tom-select-2.5.1.tgz#8c8d3f11e5c1780b5f26c9e90f4e650842ff9596"
integrity sha512-63D5/Qf6bb6kLSgksEuas/60oawDcuUHrD90jZofeOpF6bkQFYriKrvtpJBQQ4xIA5dUGcjhBbk/yrlfOQsy3g==
version "2.5.2"
resolved "https://registry.yarnpkg.com/tom-select/-/tom-select-2.5.2.tgz#77dd4bc780b1ea72905337b24f04ce19dc6d2ca1"
integrity sha512-VAlGj5MBWVLMJje2NwA3XSmxa7CUFpp1tdzFZ8wymCkcLeP0NwF4ARmSuUK4BWbmSN1fETlSazWkMIxEpP4GdQ==
dependencies:
"@orchidjs/sifter" "^1.1.0"
"@orchidjs/unicode-variants" "^1.1.2"