Files
openfoodnetwork/spec/serializers/order_serializer_spec.rb
Maikel Linke d925c2aefc Translate Spree payment, shipment and order states
- 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
2016-03-09 14:29:54 +11:00

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