Remove redundant SQL string checks in product sorting specs for clarity

This commit is contained in:
Ahmed Ejaz
2025-09-15 11:57:33 +05:00
parent 0b5efae8c4
commit 1987f0b667

View File

@@ -8,10 +8,7 @@ RSpec.describe 'ProductSortByStocks' do
describe 'class level SQL accessors' do
it 'exposes SQL Arel nodes for sorting' do
expect(Spree::Product.on_hand_sql).to be_a(Arel::Nodes::SqlLiteral)
expect(Spree::Product.on_hand_sql.to_s).to include('SELECT COALESCE(SUM')
expect(Spree::Product.backorderable_priority_sql).to be_a(Arel::Nodes::SqlLiteral)
expect(Spree::Product.backorderable_priority_sql.to_s).to include('CASE WHEN')
end
end