mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
15 lines
424 B
Ruby
15 lines
424 B
Ruby
require 'spec_helper'
|
|
|
|
describe Api::CreditCardSerializer do
|
|
let(:card) { create(:credit_card) }
|
|
let(:serializer) { Api::CreditCardSerializer.new card }
|
|
|
|
it "serializes a credit card" do
|
|
expect(serializer.to_json).to match card.last_digits.to_s
|
|
end
|
|
|
|
it "formats an identifying string with the card number masked" do
|
|
expect(serializer.formatted).to eq "Visa x-1111 Exp:#{card.month}/#{card.year}"
|
|
end
|
|
end
|