Add attribute "name" to ViewRepresenter

pull/9896/head
Wieland Lindenthal 3 years ago
parent 4e6956b014
commit c0faea6cbf
No known key found for this signature in database
GPG Key ID: 7ACCABE64832A0C6
  1. 5
      lib/api/v3/views/view_representer.rb
  2. 8
      spec/lib/api/v3/views/view_representer_rendering_spec.rb

@ -78,6 +78,11 @@ module API
query.starred
}
property :name,
getter: ->(*) {
query.name
}
date_time_property :created_at
date_time_property :updated_at

@ -93,6 +93,14 @@ describe ::API::V3::Views::ViewRepresenter, 'rendering' do
end
end
describe 'name' do
context 'with the query being name' do
it_behaves_like 'property', :name do
let(:value) { query.name }
end
end
end
describe 'timestamps' do
it_behaves_like 'datetime property', :createdAt do
let(:value) { view.created_at }

Loading…
Cancel
Save