mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Prepared things for Scott
This commit is contained in:
parent
1b9c8b0066
commit
ec78f95da1
5 changed files with 22 additions and 10 deletions
|
@ -58,6 +58,11 @@ module.exports = class SuperModel extends Backbone.Model
|
|||
return res
|
||||
else
|
||||
@addCollection collection
|
||||
@listenTo collection, 'sync', (c) ->
|
||||
console.debug 'Registering collection', url
|
||||
console.debug c
|
||||
console.debug collection
|
||||
@registerCollection c
|
||||
res = @addModelResource(collection, name, fetchOptions, value)
|
||||
res.load() if not (res.isLoading or res.isLoaded)
|
||||
return res
|
||||
|
|
|
@ -4,7 +4,7 @@ template = require 'templates/user/achievements'
|
|||
Achievement = require 'models/Achievement'
|
||||
AchievementCollection = require 'collections/AchievementCollection'
|
||||
|
||||
module.exports = class UserAchievementsViewe extends UserView
|
||||
module.exports = class UserAchievementsView extends UserView
|
||||
id: 'user-achievements-view'
|
||||
template: template
|
||||
|
||||
|
|
8
test/app/fixtures/achievements.coffee
Normal file
8
test/app/fixtures/achievements.coffee
Normal file
|
@ -0,0 +1,8 @@
|
|||
module.exports.DungeonArenaStarted =
|
||||
name: 'Dungeon Arena Started'
|
||||
description: 'Started playing Dungeon Arena. '
|
||||
worth: 3
|
||||
collection: 'level.session'
|
||||
query: "{\"level.original\":\"dungeon-arena\"}"
|
||||
userField: 'creator'
|
||||
|
|
@ -4,19 +4,11 @@ utils = require 'lib/utils'
|
|||
Achievement = require 'models/Achievement'
|
||||
EarnedAchievement = require 'models/EarnedAchievement'
|
||||
|
||||
class MockServer
|
||||
|
||||
|
||||
module.exports = ->
|
||||
me.set 'points', 48
|
||||
|
||||
unlockableObj =
|
||||
name: 'Dungeon Arena Started'
|
||||
description: 'Started playing Dungeon Arena. '
|
||||
worth: 3
|
||||
collection: 'level.session'
|
||||
query: "{\"level.original\":\"dungeon-arena\"}"
|
||||
userField: 'creator'
|
||||
unlockableObj = fixtures.DungeonArenaStarted
|
||||
|
||||
earnedUnlockableObj =
|
||||
earnedPoints: 3
|
||||
|
|
7
test/demo/views/achievement/UserAchievement.demo.coffee
Normal file
7
test/demo/views/achievement/UserAchievement.demo.coffee
Normal file
|
@ -0,0 +1,7 @@
|
|||
Achievement = require 'models/Achievement'
|
||||
Achievements = require 'collections/AchievementCollection'
|
||||
EarnedAchievement = require 'models/EarnedAchievement'
|
||||
EarnedAchievementCollection = require 'collections/EarnedAchievementCollection'
|
||||
|
||||
fixtures = require 'test/app/fixtures/achievements'
|
||||
|
Loading…
Reference in a new issue