Commit db9629b3 authored by Mark Chao's avatar Mark Chao

Allow update dates at web controller

parent 5afd8481
...@@ -66,8 +66,10 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -66,8 +66,10 @@ class Groups::EpicsController < Groups::ApplicationController
[ [
:title, :title,
:description, :description,
:start_date, :start_date_fixed,
:end_date, :start_date_is_fixed,
:due_date_fixed,
:due_date_is_fixed,
label_ids: [] label_ids: []
] ]
end end
......
...@@ -6,8 +6,14 @@ class EpicEntity < IssuableEntity ...@@ -6,8 +6,14 @@ class EpicEntity < IssuableEntity
expose :group_full_name do |epic| expose :group_full_name do |epic|
epic.group.full_name epic.group.full_name
end end
expose :start_date expose :start_date
expose :end_date expose :start_date_is_fixed?, as: :start_date_is_fixed
expose :start_date_fixed, :start_date_from_milestones
expose :end_date, as: :due_date
expose :due_date_is_fixed?, as: :due_date_is_fixed
expose :due_date_fixed, :due_date_from_milestones
expose :web_url do |epic| expose :web_url do |epic|
group_epic_path(epic.group, epic) group_epic_path(epic.group, epic)
end end
......
...@@ -183,7 +183,7 @@ describe Groups::EpicsController do ...@@ -183,7 +183,7 @@ describe Groups::EpicsController do
describe 'PUT #update' do describe 'PUT #update' do
before do before do
group.add_developer(user) group.add_developer(user)
put :update, group_id: group, id: epic.to_param, epic: { title: 'New title', label_ids: [label.id] }, format: :json put :update, group_id: group, id: epic.to_param, epic: { title: 'New title', label_ids: [label.id], start_date_fixed: '2002-01-01', start_date_is_fixed: true }, format: :json
end end
it 'returns status 200' do it 'returns status 200' do
...@@ -195,6 +195,8 @@ describe Groups::EpicsController do ...@@ -195,6 +195,8 @@ describe Groups::EpicsController do
expect(epic.title).to eq('New title') expect(epic.title).to eq('New title')
expect(epic.labels).to eq([label]) expect(epic.labels).to eq([label])
expect(epic.start_date_fixed).to eq(Date.new(2002, 1, 1))
expect(epic.start_date_is_fixed).to eq(true)
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