Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
a3aebe5363 Bump valid_email2 from 5.2.3 to 7.0.15
Bumps [valid_email2](https://github.com/micke/valid_email2) from 5.2.3 to 7.0.15.
- [Release notes](https://github.com/micke/valid_email2/releases)
- [Changelog](https://github.com/micke/valid_email2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/micke/valid_email2/compare/v5.2.3...v7.0.15)

---
updated-dependencies:
- dependency-name: valid_email2
  dependency-version: 7.0.15
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-03 09:43:46 +00:00
11 changed files with 44 additions and 111 deletions

View File

@@ -27,12 +27,7 @@ assignees: ''
- [ ] Move this issue to Test Ready.
- [ ] Notify `@testers` in [#testing].
- [ ] Test build: [Deploy to Staging] with release tag.
- [ ] 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.
- [ ] Notify a deployer to deploy it
## 3. Deployment at beginning of week
@@ -62,4 +57,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 (1.0.0)
afm (0.2.2)
angular-rails-templates (1.4.0)
railties (>= 5.0, < 8.2)
sprockets (>= 3.0, < 5)
@@ -507,7 +507,8 @@ GEM
logger
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (6.0.1)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
monetize (1.13.0)
money (~> 6.12)
@@ -519,7 +520,7 @@ GEM
mutex_m (0.3.0)
net-http (0.9.1)
uri (>= 0.11.1)
net-imap (0.5.12)
net-imap (0.6.3)
date
net-protocol
net-pop (0.1.2)
@@ -584,7 +585,7 @@ GEM
xml-simple
paypal-sdk-merchant (1.117.2)
paypal-sdk-core (~> 0.3.0)
pdf-reader (2.15.1)
pdf-reader (2.15.0)
Ascii85 (>= 1.0, < 3.0, != 2.0.0)
afm (>= 0.2.1, < 2)
hashery (~> 2.0)
@@ -924,8 +925,8 @@ GEM
unicode-emoji (4.2.0)
uniform_notifier (1.18.0)
uri (1.1.1)
valid_email2 (5.2.3)
activemodel (>= 3.2)
valid_email2 (7.0.15)
activemodel (>= 6.0)
mail (~> 2.5)
validate_url (1.0.15)
activemodel (>= 3.0.0)

View File

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

View File

@@ -76,7 +76,6 @@ 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,6 +25,9 @@ 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.cc_type
return false unless source.brand
provider_class.supports?(source.cc_type)
provider_class.supports?(source.brand)
end
end
end

View File

@@ -193,25 +193,4 @@ 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,69 +206,6 @@ 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,6 +79,12 @@ 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,10 +167,7 @@ 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)
build_list(:taxon, 11).each_with_index do |taxon, i|
taxon.name += " #{i}"
taxon.save!
end
create_list(:taxon, 11)
visit admin_products_url
end
@@ -181,8 +178,24 @@ 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.1"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-4.0.1.tgz#d30f61568df248e22be864b6b86d22540438d0f6"
integrity sha512-zjh2YxGhTMbddFUxyMOc35Iq0v86N7JnsB62m4hm34fG/CVX1ard7Gp3AJN4PK9lSLFexK14zPMNVwSYgz3tRg==
version "4.0.0"
resolved "https://registry.yarnpkg.com/hotkeys-js/-/hotkeys-js-4.0.0.tgz#75336c0ac610ad384d286c61c519909dcd4bdf6b"
integrity sha512-gIoeqMWYqPIItc4HaseVbtTRpEpBbeufZMUcoWtN62JZdDq3KadS1ijN6wpaDjTzRK7PjT3QOPUcx+yNT0rrZQ==
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.2"
resolved "https://registry.yarnpkg.com/tom-select/-/tom-select-2.5.2.tgz#77dd4bc780b1ea72905337b24f04ce19dc6d2ca1"
integrity sha512-VAlGj5MBWVLMJje2NwA3XSmxa7CUFpp1tdzFZ8wymCkcLeP0NwF4ARmSuUK4BWbmSN1fETlSazWkMIxEpP4GdQ==
version "2.5.1"
resolved "https://registry.yarnpkg.com/tom-select/-/tom-select-2.5.1.tgz#8c8d3f11e5c1780b5f26c9e90f4e650842ff9596"
integrity sha512-63D5/Qf6bb6kLSgksEuas/60oawDcuUHrD90jZofeOpF6bkQFYriKrvtpJBQQ4xIA5dUGcjhBbk/yrlfOQsy3g==
dependencies:
"@orchidjs/sifter" "^1.1.0"
"@orchidjs/unicode-variants" "^1.1.2"