1
0
Fork 0
discourse-custom-wizard-unl.../spec/serializers/custom_wizard/pro/subscription_serializer_spec.rb

15 Zeilen
504 B
Ruby

2021-09-07 14:06:13 +02:00
# frozen_string_literal: true
require_relative '../../../plugin_helper'
describe CustomWizard::ProSubscriptionSerializer do
it 'should return pro subscription attributes' do
sub = CustomWizard::ProSubscription.new(OpenStruct.new(type: 'community', updated_at: Time.now))
serialized = described_class.new(sub, root: false).as_json
expect(serialized[:active]).to eq(true)
expect(serialized[:type]).to eq('community')
expect(serialized[:updated_at]).to eq(sub.updated_at)
end
end