Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Save description when new iteration created #1726

Merged
merged 1 commit into from
Oct 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions controller/iteration.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type IterationController struct {
}

// IterationControllerConfiguration configuration for the IterationController

type IterationControllerConfiguration interface {
GetCacheControlIterations() string
GetCacheControlIteration() string
Expand Down Expand Up @@ -84,12 +83,13 @@ func (c *IterationController) CreateChild(ctx *app.CreateChildIterationContext)
}

newItr := iteration.Iteration{
SpaceID: parent.SpaceID,
Path: childPath,
Name: *reqIter.Attributes.Name,
StartAt: reqIter.Attributes.StartAt,
EndAt: reqIter.Attributes.EndAt,
UserActive: *reqIter.Attributes.UserActive,
SpaceID: parent.SpaceID,
Path: childPath,
Name: *reqIter.Attributes.Name,
Description: reqIter.Attributes.Description,
StartAt: reqIter.Attributes.StartAt,
EndAt: reqIter.Attributes.EndAt,
UserActive: *reqIter.Attributes.UserActive,
}

err = appl.Iterations().Create(ctx, &newItr)
Expand Down
10 changes: 6 additions & 4 deletions controller/iteration_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (rest *TestIterationREST) TestSuccessCreateChildIteration() {
require.NotNil(rest.T(), created)
assertChildIterationLinking(rest.T(), created.Data)
assert.Equal(rest.T(), *ci.Data.Attributes.Name, *created.Data.Attributes.Name)
assert.Equal(rest.T(), *ci.Data.Attributes.Description, *created.Data.Attributes.Description)
expectedParentPath := parent.Path.String() + path.SepInService + parentID.String()
expectedResolvedParentPath := path.SepInService + ri.Name + path.SepInService + parent.Name
assert.Equal(rest.T(), expectedParentPath, *created.Data.Attributes.ParentPath)
Expand Down Expand Up @@ -659,14 +660,15 @@ func getChildIterationPayload(name *string) *app.CreateChildIterationPayload {
end := start.Add(time.Hour * (24 * 8 * 3))

itType := iteration.APIStringTypeIteration

desc := "Some description"
return &app.CreateChildIterationPayload{
Data: &app.Iteration{
Type: itType,
Attributes: &app.IterationAttributes{
Name: name,
StartAt: &start,
EndAt: &end,
Name: name,
Description: &desc,
StartAt: &start,
EndAt: &end,
},
},
}
Expand Down