mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
- Copied translations for payment_states, shipment_states and order_states into locale en.yml. - Enabled global Javascript function `translate` to deal with scopes like 'spree.shipment_states'. - Removed `humanize` call from order serializer and added translation scopes to accounts page. - Test OrderSerializer for untranslated attributes - Require spec helper in serializer specs
18 lines
438 B
Ruby
18 lines
438 B
Ruby
require 'spec_helper'
|
|
|
|
describe Api::OrderSerializer do
|
|
let(:serializer) { Api::OrderSerializer.new order }
|
|
let(:order) { create(:completed_order_with_totals) }
|
|
|
|
|
|
it "serializes an order" do
|
|
expect(serializer.to_json).to match order.number.to_s
|
|
end
|
|
|
|
it "convert the state attributes to translatable keys" do
|
|
expect(serializer.to_json).to match "complete"
|
|
expect(serializer.to_json).to match "balance_due"
|
|
end
|
|
|
|
end
|