0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-30 04:30:29 +01:00
discourse-custom-wizard/spec/serializers/custom_wizard/subscription/subscription_serializer_spec.rb

15 Zeilen
520 B
Ruby

2021-09-07 14:06:13 +02:00
# frozen_string_literal: true
require_relative '../../../plugin_helper'
2021-09-24 11:58:42 +02:00
describe CustomWizard::Subscription::SubscriptionSerializer do
it 'should return subscription attributes' do
2021-10-27 15:09:34 +02:00
sub = CustomWizard::Subscription::Subscription.new(OpenStruct.new(type: 'standard', updated_at: Time.now))
2021-09-07 14:06:13 +02:00
serialized = described_class.new(sub, root: false).as_json
expect(serialized[:active]).to eq(true)
2021-10-27 15:09:34 +02:00
expect(serialized[:type]).to eq('standard')
2021-09-07 14:06:13 +02:00
expect(serialized[:updated_at]).to eq(sub.updated_at)
end
end