Fix API's broken organization's image (#11981)

This commit is contained in:
Mac Siri 2020-12-21 07:20:16 -05:00 committed by GitHub
parent 04b91520c4
commit 893151d76b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -4,7 +4,7 @@ module Api
before_action :find_organization, only: %i[users listings]
SHOW_ATTRIBUTES_FOR_SERIALIZATION = %i[
username name summary twitter_username github_username url
id username name summary twitter_username github_username url
location created_at profile_image tech_stack tag_line story
].freeze
private_constant :SHOW_ATTRIBUTES_FOR_SERIALIZATION

View file

@ -13,16 +13,19 @@ RSpec.describe "Api::V0::Organizations", type: :request do
get api_organization_path(organization.username)
response_organization = response.parsed_body
expect(response_organization["type_of"]).to eq("organization")
expect(response_organization).to include(
{
"profile_image" => organization.profile_image_url,
"type_of" => "organization",
"joined_at" => organization.created_at.utc.iso8601
},
)
%w[
username name summary twitter_username github_username url location tech_stack tag_line story
].each do |attr|
expect(response_organization[attr]).to eq(organization.public_send(attr))
end
expect(response_organization["joined_at"]).to eq(organization.created_at.utc.iso8601)
end
end