Merge remote-tracking branch 'origin/feature/rails3' into feature/magic_comparison

pull/513/head
Nils Kenneweg 11 years ago
commit 9cededd4c3
  1. 4
      app/views/api/v2/planning_elements/index.api.rabl
  2. 5
      spec/views/api/v2/planning_elements/index_api_json_spec.rb

@ -50,6 +50,10 @@ child :type => :planning_element_type do
attributes :id, :name
end
child :status => :planning_element_status do
attributes :id, :name
end
node :children, unless: lambda{|pe| pe.children.empty?} do |pe|
pe.children.to_a.map { |wp| { id: wp.id, subject: wp.subject}}
end

@ -79,6 +79,11 @@ describe 'api/v2/planning_elements/index.api.rabl' do
end
it 'should render a status-element' do
expected_json = {id: wp1.status.id, name: wp1.status.name}.to_json
response.body.should be_json_eql(expected_json).at_path("planning_elements/0/planning_element_status")
end
it 'should render a project with name and identifier' do
expected_json = {name: "Sample Project", identifier: "sample_project"}.to_json

Loading…
Cancel
Save