Fix API's broken organization's image (#11981)
This commit is contained in:
parent
04b91520c4
commit
893151d76b
2 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue