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 # frozen_string_literal: true
class DependencyEntity < Grape::Entity class DependencyEntity < Grape::Entity
expose :name, :packager, :version class LocationEntity < Grape::Entity
expose :location do
expose :blob_path, :path expose :blob_path, :path
end end
expose :name, :packager, :version
expose :location, using: LocationEntity
end end
...@@ -18,10 +18,6 @@ describe DependencyEntity do ...@@ -18,10 +18,6 @@ describe DependencyEntity do
subject { described_class.represent(dependency).as_json } subject { described_class.represent(dependency).as_json }
it { is_expected.to include(:name) } it { is_expected.to eq(dependency) }
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) }
end end
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