Commit b68d1861 authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Bob Van Landuyt

Fix null blob_path

Nested `expose` returns null unless it's a part
of Entity class
parent afb0405b
# frozen_string_literal: true
class DependencyEntity < Grape::Entity
expose :name, :packager, :version
expose :location do
class LocationEntity < Grape::Entity
expose :blob_path, :path
end
expose :name, :packager, :version
expose :location, using: LocationEntity
end
......@@ -18,10 +18,6 @@ describe DependencyEntity do
subject { described_class.represent(dependency).as_json }
it { is_expected.to include(:name) }
it { is_expected.to include(:version) }
it { is_expected.to include(:packager) }
it { expect(subject[:location]).to include(:blob_path) }
it { expect(subject[:location]).to include(:path) }
it { is_expected.to eq(dependency) }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment