mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-01 19:36:57 -05:00
17 lines
489 B
CoffeeScript
17 lines
489 B
CoffeeScript
|
User = require 'models/User'
|
||
|
|
||
|
describe 'UserModel', ->
|
||
|
it 'experience functions are correct', ->
|
||
|
expect(User.expForLevel(User.levelFromExp 0)).toBe 0
|
||
|
expect(User.expForLevel(User.levelFromExp 50)).toBe 50
|
||
|
expect(User.expForLevel 1).toBe 0
|
||
|
expect(User.expForLevel 2).toBeGreaterThan User.expForLevel 1
|
||
|
|
||
|
it 'level is calculated correctly', ->
|
||
|
me.set 'points', 0
|
||
|
expect(me.level()).toBe 1
|
||
|
|
||
|
me.set 'points', 50
|
||
|
expect(me.level()).toBe User.levelFromExp 50
|
||
|
|