mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
26 lines
638 B
Ruby
26 lines
638 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
RSpec.describe Api::Admin::VariantSerializer do
|
|
let(:variant) { create(:variant) }
|
|
|
|
it "serializes the variant name" do
|
|
serializer = Api::Admin::VariantSerializer.new variant
|
|
|
|
expect(serializer.to_json).to match variant.name
|
|
end
|
|
|
|
it "serializes the variant options" do
|
|
serializer = Api::Admin::VariantSerializer.new variant
|
|
|
|
expect(serializer.to_json).to match variant.options_text
|
|
end
|
|
|
|
it "serializes the variant full name" do
|
|
serializer = Api::Admin::VariantSerializer.new variant
|
|
|
|
expect(serializer.to_json).to match variant.full_name
|
|
end
|
|
end
|