Commit 05f58fea authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Added hidden field to permitted update parameters

Allows default cycle analytics stages to be hidden
via a PUT request. Also adds a corresponding test.
parent 210ca040
...@@ -109,7 +109,7 @@ module Analytics ...@@ -109,7 +109,7 @@ module Analytics
end end
def update_params def update_params
params.permit(:name, :start_event_identifier, :end_event_identifier, :id, :move_after_id, :move_before_id) params.permit(:name, :start_event_identifier, :end_event_identifier, :id, :move_after_id, :move_before_id, :hidden)
end end
def create_params def create_params
......
...@@ -118,6 +118,20 @@ describe Analytics::CycleAnalytics::StagesController do ...@@ -118,6 +118,20 @@ describe Analytics::CycleAnalytics::StagesController do
expect(stage.name).to eq(params[:name]) expect(stage.name).to eq(params[:name])
end end
context 'hidden attribute' do
before do
params[:hidden] = true
end
it 'updates the hidden attribute' do
subject
stage.reload
expect(stage.hidden).to eq(true)
end
end
context 'when positioning parameter is given' do context 'when positioning parameter is given' do
before do before do
params[:move_before_id] = create(:cycle_analytics_group_stage, parent: group, relative_position: 10).id params[:move_before_id] = create(:cycle_analytics_group_stage, parent: group, relative_position: 10).id
......
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