Commit e23ee67a authored by Mark Chao's avatar Mark Chao

Fix bug where start_date is not updated at web

parent db9629b3
...@@ -83,7 +83,7 @@ class Groups::EpicsController < Groups::ApplicationController ...@@ -83,7 +83,7 @@ class Groups::EpicsController < Groups::ApplicationController
end end
def update_service def update_service
::Epics::UpdateService.new(@group, current_user, epic_params) ::Epics::UpdateService.new(@group, current_user, epic_params.stringify_keys)
end end
def finder_type def finder_type
......
...@@ -7,7 +7,7 @@ module Epics ...@@ -7,7 +7,7 @@ module Epics
update(epic) update(epic)
if (params.keys & [:start_date_fixed, :start_date_is_fixed, :due_date_fixed, :due_date_is_fixed]).present? if (params.keys.map(&:to_sym) & [:start_date_fixed, :start_date_is_fixed, :due_date_fixed, :due_date_is_fixed]).present?
epic.update_dates epic.update_dates
end end
......
...@@ -181,6 +181,8 @@ describe Groups::EpicsController do ...@@ -181,6 +181,8 @@ describe Groups::EpicsController do
end end
describe 'PUT #update' do describe 'PUT #update' do
let(:date) { Date.new(2002, 1, 1)}
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], start_date_fixed: '2002-01-01', start_date_is_fixed: true }, 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
...@@ -195,7 +197,8 @@ describe Groups::EpicsController do ...@@ -195,7 +197,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_fixed).to eq(date)
expect(epic.start_date).to eq(date)
expect(epic.start_date_is_fixed).to eq(true) 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