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
angusmcleod 084c6f4a7a wip
2021-09-24 17:58:42 +08:00

14 Zeilen
522 B
Ruby

# frozen_string_literal: true
require_relative '../../../plugin_helper'
describe CustomWizard::Subscription::SubscriptionSerializer do
it 'should return subscription attributes' do
sub = CustomWizard::Subscription::Subscription.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