[instagram] add children of bodom as a testing band :]
This commit is contained in:
parent
551d06fbe0
commit
4834dc5908
@ -155,12 +155,12 @@ func TestModel_Swap(t *testing.T) {
|
||||
iti_single.Author = &author
|
||||
storyDoc := Create(iti_single).(*story)
|
||||
saveDoc(t, storyDoc)
|
||||
storyDoc.Chapters[0].Bands = append(storyDoc.Chapters[0].Bands, metallica)
|
||||
storyDoc.Chapters[0].Bands = append(storyDoc.Chapters[0].Bands, bodom)
|
||||
assert.Equal(t, 2, len(storyDoc.Chapters[0].Bands))
|
||||
err := storyDoc.Swap("Chapters[0].Bands", 0, 1)
|
||||
assert.Nil(t, err)
|
||||
c := storyDoc.Chapters[0].Bands
|
||||
assert.Equal(t, metallica.ID, c[0].ID)
|
||||
assert.Equal(t, dh.ID, c[1].ID)
|
||||
assert.Equal(t, bodom.ID, c[0].ID)
|
||||
assert.Equal(t, diamondHead.ID, c[1].ID)
|
||||
saveDoc(t, storyDoc)
|
||||
}
|
||||
|
33
testing.go
33
testing.go
@ -138,13 +138,13 @@ func genChaps(single bool) []chapter {
|
||||
return ret
|
||||
}
|
||||
|
||||
var iti_single story = story{
|
||||
var iti_single = story{
|
||||
Title: "title",
|
||||
Completed: true,
|
||||
Chapters: genChaps(true),
|
||||
}
|
||||
|
||||
var iti_multi story = story{
|
||||
var iti_multi = story{
|
||||
Title: "Brian Tatler Fucked and Abused Sean Harris",
|
||||
Completed: false,
|
||||
Chapters: genChaps(false),
|
||||
@ -190,11 +190,30 @@ var metallica = band{
|
||||
Locked: false,
|
||||
}
|
||||
|
||||
var dh = band{
|
||||
ID: 503,
|
||||
Name: "Diamond Head",
|
||||
Locked: false,
|
||||
Characters: []string{"Brian Tatler", "Sean Harris", "Duncan Scott", "Colin Kimberley"},
|
||||
var diamondHead = band{
|
||||
ID: 503,
|
||||
Name: "Diamond Head",
|
||||
Locked: false,
|
||||
Characters: []string{
|
||||
"Brian Tatler",
|
||||
"Sean Harris",
|
||||
"Duncan Scott",
|
||||
"Colin Kimberley",
|
||||
},
|
||||
}
|
||||
var bodom = band{
|
||||
ID: 74,
|
||||
Name: "Children of Bodom",
|
||||
Locked: false,
|
||||
Characters: []string{
|
||||
"Janne Wirman",
|
||||
"Alexi Laiho",
|
||||
"Jaska Raatikainen",
|
||||
"Henkka T. Blacksmith",
|
||||
"Roope Latvala",
|
||||
"Daniel Freyberg",
|
||||
"Alexander Kuoppala",
|
||||
},
|
||||
}
|
||||
|
||||
func saveDoc(t *testing.T, doc IModel) {
|
||||
|
Loading…
Reference in New Issue
Block a user