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

Commit

Permalink
Save description when new iteration created (#1726)
Browse files Browse the repository at this point in the history
  • Loading branch information
baijum authored Oct 24, 2017
1 parent 2a8fd6b commit c8f8956
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
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

0 comments on commit c8f8956

Please sign in to comment.