Removed a redundant change-element from the journals-xml

pull/527/head
Stefan Frank 11 years ago
parent 2d476575a3
commit 3187489746
  1. 5
      app/views/api/v2/planning_element_journals/_journal.api.rabl
  2. 0
      app/views/api/v2/projects/_project.api.rabl
  3. 0
      app/views/api/v2/projects/index.api.rabl
  4. 4
      spec/views/api/v2/planning_elements/show_api_json_spec.rb

@ -37,10 +37,9 @@ node :user do |journal|
end
node :changes do |journal|
journal.changed_data.map do |attribute, changes|
user_friendly_attribute, old, new = user_friendly_change(journal, attribute)
{change: {
{
technical: {
name: attribute.to_s,
old: changes.first,
@ -51,7 +50,7 @@ node :changes do |journal|
old: old,
new: new
}
}}
}
end
end

@ -234,10 +234,10 @@ describe 'api/v2/planning_elements/show.api.rabl' do
it 'reports the changes' do
expected_json = {name: "subject", old: "old_subject", new: "new_subject"}.to_json
should be_json_eql(expected_json).at_path('planning_element/journals/0/changes/0/change/technical')
should be_json_eql(expected_json).at_path('planning_element/journals/0/changes/0/technical')
expected_json = {name: "project_id", old: 1, new: 2}.to_json
should be_json_eql(expected_json).at_path('planning_element/journals/1/changes/0/change/technical')
should be_json_eql(expected_json).at_path('planning_element/journals/1/changes/0/technical')
end
end

Loading…
Cancel
Save