docbrown/spec/serializers/search/organization_serializer_spec.rb
Lawrence 2da9b9a0af
Organization Search Filtering (#19430)
* add org fitlering init logic

* further styling of the org block

* add tests and fix sort by error

* serializer spec

* org slug instead of twitter

* add utility CSS
2023-05-08 14:58:25 -05:00

13 lines
549 B
Ruby

require "rails_helper"
RSpec.describe Search::OrganizationSerializer do
let(:organization) { create(:organization) }
it "serializes a organization" do
data_hash = described_class.new(organization).serializable_hash.dig(:data, :attributes)
expect(data_hash.keys).to include(:id, :name, :summary, :profile_image, :twitter_username, :nav_image, :slug)
expect(data_hash[:id]).to eq(organization.id)
expect(data_hash[:name]).to eq(organization.name)
expect(data_hash[:profile_image]).to eq(organization.profile_image)
end
end