instance_serializer_spec.rb 554 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe REST::InstanceSerializer do
  4. let(:serialization) { serialized_record_json(record, described_class) }
  5. let(:record) { InstancePresenter.new }
  6. describe 'usage' do
  7. it 'returns recent usage data' do
  8. expect(serialization['usage']).to eq({ 'users' => { 'active_month' => 0 } })
  9. end
  10. it 'returns the VAPID public key' do
  11. expect(serialization['configuration']['vapid']).to eq({
  12. 'public_key' => Rails.configuration.x.vapid_public_key,
  13. })
  14. end
  15. end
  16. end