mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-30 19:06:59 -05:00
Updated translation
This commit is contained in:
commit
7d7b77e753
12 changed files with 80 additions and 26 deletions
|
@ -1,6 +1,6 @@
|
||||||
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
|
SpriteBuilder = require 'lib/sprites/SpriteBuilder'
|
||||||
|
|
||||||
floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05', 'Goal Trigger', 'Obstacle', 'Sand 01', 'Sand 02', 'Sand 03', 'Sand 04', 'Sand 05', 'Sand 06']
|
floors = ['Dungeon Floor', 'Indoor Floor', 'Grass', 'Grass01', 'Grass02', 'Grass03', 'Grass04', 'Grass05', 'Goal Trigger', 'Obstacle', 'Sand 01', 'Sand 02', 'Sand 03', 'Sand 04', 'Sand 05', 'Sand 06', 'Talus 1', 'Talus 2', 'Talus 3', 'Talus 4', 'Talus 5', 'Talus 6']
|
||||||
|
|
||||||
module.exports = class SingularSprite extends createjs.Sprite
|
module.exports = class SingularSprite extends createjs.Sprite
|
||||||
childMovieClips: null
|
childMovieClips: null
|
||||||
|
|
|
@ -6,7 +6,11 @@ module.exports = nativeDescription: "български език", englishDescri
|
||||||
play: "Играй" # The big play button that opens up the campaign view.
|
play: "Играй" # The big play button that opens up the campaign view.
|
||||||
old_browser: "О, не! Браузърът ти е твърде стар за CodeCombat. Съжалявам!" # Warning that shows up on really old Firefox/Chrome/Safari
|
old_browser: "О, не! Браузърът ти е твърде стар за CodeCombat. Съжалявам!" # Warning that shows up on really old Firefox/Chrome/Safari
|
||||||
old_browser_suffix: "Все пак можеш да опиваш, но най-вероятно няма да проработи."
|
old_browser_suffix: "Все пак можеш да опиваш, но най-вероятно няма да проработи."
|
||||||
|
<<<<<<< HEAD
|
||||||
ipad_browser: "Лошa новинa: CodeCombat не работи в браузъра на iPad. Добра новина: Приложението ни за iPad изчаква одобрение от Apple."
|
ipad_browser: "Лошa новинa: CodeCombat не работи в браузъра на iPad. Добра новина: Приложението ни за iPad изчаква одобрение от Apple."
|
||||||
|
=======
|
||||||
|
# ipad_browser: "Bad news: CodeCombat doesn't run on iPad in the browser. Good news: our native iPad app is awaiting Apple approval."
|
||||||
|
>>>>>>> upstream/master
|
||||||
campaign: "Кампания"
|
campaign: "Кампания"
|
||||||
for_beginners: "За начинаещи"
|
for_beginners: "За начинаещи"
|
||||||
# multiplayer: "Multiplayer" # Not currently shown on home page
|
# multiplayer: "Multiplayer" # Not currently shown on home page
|
||||||
|
@ -60,7 +64,11 @@ module.exports = nativeDescription: "български език", englishDescri
|
||||||
# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased
|
# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased
|
||||||
available: "Достъпен"
|
available: "Достъпен"
|
||||||
# skills_granted: "Skills Granted" # Property documentation details
|
# skills_granted: "Skills Granted" # Property documentation details
|
||||||
|
<<<<<<< HEAD
|
||||||
heroes: "Герои" # Tooltip on hero shop button from /play
|
heroes: "Герои" # Tooltip on hero shop button from /play
|
||||||
|
=======
|
||||||
|
# heroes: "Heroes" # Tooltip on hero shop button from /play
|
||||||
|
>>>>>>> upstream/master
|
||||||
achievements: "Постижения" # Tooltip on achievement list button from /play
|
achievements: "Постижения" # Tooltip on achievement list button from /play
|
||||||
account: "Акаунт" # Tooltip on account button from /play
|
account: "Акаунт" # Tooltip on account button from /play
|
||||||
settings: "Настройки" # Tooltip on settings button from /play
|
settings: "Настройки" # Tooltip on settings button from /play
|
||||||
|
@ -69,7 +77,11 @@ module.exports = nativeDescription: "български език", englishDescri
|
||||||
# choose_inventory: "Equip Items"
|
# choose_inventory: "Equip Items"
|
||||||
buy_gems: "Купи скъпоценни камъни"
|
buy_gems: "Купи скъпоценни камъни"
|
||||||
subscription_required: "Нужен е абонамент"
|
subscription_required: "Нужен е абонамент"
|
||||||
|
<<<<<<< HEAD
|
||||||
older_campaigns: "Предишни кампании"
|
older_campaigns: "Предишни кампании"
|
||||||
|
=======
|
||||||
|
older_campaigns: "Предишни капмании"
|
||||||
|
>>>>>>> upstream/master
|
||||||
anonymous: "Анонимен играч"
|
anonymous: "Анонимен играч"
|
||||||
level_difficulty: "Трудност"
|
level_difficulty: "Трудност"
|
||||||
campaign_beginner: "Кампания за начинаещи"
|
campaign_beginner: "Кампания за начинаещи"
|
||||||
|
@ -92,8 +104,13 @@ module.exports = nativeDescription: "български език", englishDescri
|
||||||
campaign_classic_algorithms: "Класически алгоритми"
|
campaign_classic_algorithms: "Класически алгоритми"
|
||||||
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
|
# campaign_classic_algorithms_description: "... in which you learn the most popular algorithms in Computer Science."
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
# share_progress_modal:
|
# share_progress_modal:
|
||||||
blurb: "Справяш се чудесно! Сподели с някого,колко много научи чрез CodeCombat."
|
blurb: "Справяш се чудесно! Сподели с някого,колко много научи чрез CodeCombat."
|
||||||
|
=======
|
||||||
|
share_progress_modal:
|
||||||
|
# blurb: "You’re making great progress! Tell someone how much you've learned with CodeCombat."
|
||||||
|
>>>>>>> upstream/master
|
||||||
email_invalid: "Имейл адресът е невалиден"
|
email_invalid: "Имейл адресът е невалиден"
|
||||||
# form_blurb: "Enter their email below and we’ll show them!"
|
# form_blurb: "Enter their email below and we’ll show them!"
|
||||||
form_label: "Електронна поща"
|
form_label: "Електронна поща"
|
||||||
|
@ -114,7 +131,11 @@ module.exports = nativeDescription: "български език", englishDescri
|
||||||
# finishing: "Finishing"
|
# finishing: "Finishing"
|
||||||
sign_in_with_facebook: "Вписване чрез Facebook"
|
sign_in_with_facebook: "Вписване чрез Facebook"
|
||||||
sign_in_with_gplus: "Вписване чрез G+"
|
sign_in_with_gplus: "Вписване чрез G+"
|
||||||
|
<<<<<<< HEAD
|
||||||
signup_switch: "Създаване на нов акаунт?"
|
signup_switch: "Създаване на нов акаунт?"
|
||||||
|
=======
|
||||||
|
# signup_switch: "Want to create an account?"
|
||||||
|
>>>>>>> upstream/master
|
||||||
|
|
||||||
signup:
|
signup:
|
||||||
email_announcements: "Получава анонси по имейл"
|
email_announcements: "Получава анонси по имейл"
|
||||||
|
|
|
@ -15,7 +15,7 @@ module.exports = class LevelComponent extends CocoModel
|
||||||
@ProgrammableID: '524b7b5a7fc0f6d51900000e'
|
@ProgrammableID: '524b7b5a7fc0f6d51900000e'
|
||||||
@MovesID: '524b7b8c7fc0f6d519000013'
|
@MovesID: '524b7b8c7fc0f6d519000013'
|
||||||
@MissileID: '524cc2593ea855e0ab000142'
|
@MissileID: '524cc2593ea855e0ab000142'
|
||||||
@FindsPaths: '52872b0ead92b98561000002'
|
@FindsPathsID: '52872b0ead92b98561000002'
|
||||||
urlRoot: '/db/level.component'
|
urlRoot: '/db/level.component'
|
||||||
|
|
||||||
set: (key, val, options) ->
|
set: (key, val, options) ->
|
||||||
|
|
|
@ -562,6 +562,9 @@ $itemSlotGridHeight: 51px
|
||||||
&.torso
|
&.torso
|
||||||
z-index: 14
|
z-index: 14
|
||||||
|
|
||||||
|
&.male-back, &.female-back
|
||||||
|
z-index: 11
|
||||||
|
|
||||||
&.gloves
|
&.gloves
|
||||||
z-index: 15
|
z-index: 15
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ module.exports = class SubscriptionView extends RootView
|
||||||
else
|
else
|
||||||
c.nextPaymentDate = periodEnd
|
c.nextPaymentDate = periodEnd
|
||||||
c.cost = "$#{(subscription.plan.amount/100).toFixed(2)}"
|
c.cost = "$#{(subscription.plan.amount/100).toFixed(2)}"
|
||||||
if card = @stripeInfo.cards?.data?[0]
|
if card = @stripeInfo.sources?.data?[0]
|
||||||
c.card = "#{card.brand}: x#{card.last4}"
|
c.card = "#{card.brand}: x#{card.last4}"
|
||||||
if @payments?.loaded
|
if @payments?.loaded
|
||||||
c.monthsSubscribed = (x for x in @payments.models when not x.get('productID')).length # productID is for gem purchases
|
c.monthsSubscribed = (x for x in @payments.models when not x.get('productID')).length # productID is for gem purchases
|
||||||
|
|
|
@ -110,6 +110,7 @@ defaultTasks =
|
||||||
Item: commonTasks.concat purchasableTasks.concat [
|
Item: commonTasks.concat purchasableTasks.concat [
|
||||||
'Set the hero class if class-specific.'
|
'Set the hero class if class-specific.'
|
||||||
'Upload Paper Doll Images.'
|
'Upload Paper Doll Images.'
|
||||||
|
'Configure item stats and abilities.'
|
||||||
]
|
]
|
||||||
Missile: commonTasks.concat animatedThangTypeTasks.concat [
|
Missile: commonTasks.concat animatedThangTypeTasks.concat [
|
||||||
'Make sure there is a launch sound trigger.'
|
'Make sure there is a launch sound trigger.'
|
||||||
|
@ -152,7 +153,9 @@ module.exports = class ThangTypeEditView extends RootView
|
||||||
'click .play-with-level-parent': 'onPlayLevelSelect'
|
'click .play-with-level-parent': 'onPlayLevelSelect'
|
||||||
'keyup .play-with-level-input': 'onPlayLevelKeyUp'
|
'keyup .play-with-level-input': 'onPlayLevelKeyUp'
|
||||||
'click li:not(.disabled) > #pop-level-i18n-button': 'onPopulateLevelI18N'
|
'click li:not(.disabled) > #pop-level-i18n-button': 'onPopulateLevelI18N'
|
||||||
|
'mousedown #canvas': 'onCanvasMouseDown'
|
||||||
|
'mouseup #canvas': 'onCanvasMouseUp'
|
||||||
|
'mousemove #canvas': 'onCanvasMouseMove'
|
||||||
|
|
||||||
onClickSetVectorIcon: ->
|
onClickSetVectorIcon: ->
|
||||||
modal = new VectorIconSetupModal({}, @thangType)
|
modal = new VectorIconSetupModal({}, @thangType)
|
||||||
|
@ -411,6 +414,7 @@ module.exports = class ThangTypeEditView extends RootView
|
||||||
@layerAdapter.resetSpriteSheet()
|
@layerAdapter.resetSpriteSheet()
|
||||||
@layerAdapter.addLank(lank)
|
@layerAdapter.addLank(lank)
|
||||||
@currentLank = lank
|
@currentLank = lank
|
||||||
|
@currentLankOffset = null
|
||||||
|
|
||||||
showSprite: (sprite) ->
|
showSprite: (sprite) ->
|
||||||
@clearDisplayObject()
|
@clearDisplayObject()
|
||||||
|
@ -621,6 +625,31 @@ module.exports = class ThangTypeEditView extends RootView
|
||||||
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1024,height=560,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true)
|
@childWindow = window.open("/play/level/#{scratchLevelID}", 'child_window', 'width=1024,height=560,left=10,top=10,location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0', true)
|
||||||
@childWindow.focus()
|
@childWindow.focus()
|
||||||
|
|
||||||
|
# Canvas mouse drag handlers
|
||||||
|
|
||||||
|
onCanvasMouseMove: (e) ->
|
||||||
|
return unless p1 = @canvasDragStart
|
||||||
|
p2 = x: e.offsetX, y: e.offsetY
|
||||||
|
offset = x: p2.x - p1.x, y: p2.y - p1.y
|
||||||
|
@currentLank.sprite.x = @currentLankOffset.x + offset.x / @scale
|
||||||
|
@currentLank.sprite.y = @currentLankOffset.y + offset.y / @scale
|
||||||
|
@canvasDragOffset = offset
|
||||||
|
|
||||||
|
onCanvasMouseDown: (e) ->
|
||||||
|
return unless @currentLank
|
||||||
|
@canvasDragStart = x: e.offsetX, y: e.offsetY
|
||||||
|
@currentLankOffset ?= x: @currentLank.sprite.x, y: @currentLank.sprite.y
|
||||||
|
|
||||||
|
onCanvasMouseUp: (e) ->
|
||||||
|
@canvasDragStart = null
|
||||||
|
return unless @canvasDragOffset
|
||||||
|
return unless node = @treema.getLastSelectedTreema()
|
||||||
|
offset = node.get '/'
|
||||||
|
offset.x += Math.round @canvasDragOffset.x
|
||||||
|
offset.y += Math.round @canvasDragOffset.y
|
||||||
|
@canvasDragOffset = null
|
||||||
|
node.set '/', offset
|
||||||
|
|
||||||
destroy: ->
|
destroy: ->
|
||||||
@camera?.destroy()
|
@camera?.destroy()
|
||||||
super()
|
super()
|
||||||
|
|
|
@ -619,7 +619,7 @@ module.exports = class InventoryModal extends ModalView
|
||||||
item = _.find @items.models, (item) -> item.get('original') is original
|
item = _.find @items.models, (item) -> item.get('original') is original
|
||||||
continue unless dollImages = item?.get('dollImages')
|
continue unless dollImages = item?.get('dollImages')
|
||||||
didAdd = @addDollImage slot, dollImages, heroClass, gender
|
didAdd = @addDollImage slot, dollImages, heroClass, gender
|
||||||
slotsWithImages.push slot if didAdd
|
slotsWithImages.push slot if didAdd if item.get('original') isnt '54ea39342b7506e891ca70f2' # Circlet of the Magi needs hair under it
|
||||||
@$el.find('#hero-image-hair').toggle not ('head' in slotsWithImages)
|
@$el.find('#hero-image-hair').toggle not ('head' in slotsWithImages)
|
||||||
@$el.find('#hero-image-thumb').toggle not ('gloves' in slotsWithImages)
|
@$el.find('#hero-image-thumb').toggle not ('gloves' in slotsWithImages)
|
||||||
|
|
||||||
|
@ -637,6 +637,8 @@ module.exports = class InventoryModal extends ModalView
|
||||||
imageKeys = ["#{gender}#{heroClass}", "#{gender}#{heroClass}Thumb"]
|
imageKeys = ["#{gender}#{heroClass}", "#{gender}#{heroClass}Thumb"]
|
||||||
else
|
else
|
||||||
imageKeys = ["#{gender}", "#{gender}Thumb"]
|
imageKeys = ["#{gender}", "#{gender}Thumb"]
|
||||||
|
else if heroClass is 'Wizard' and slot is 'torso'
|
||||||
|
imageKeys = [gender, "#{gender}Back"]
|
||||||
else
|
else
|
||||||
imageKeys = [gender]
|
imageKeys = [gender]
|
||||||
for imageKey in imageKeys
|
for imageKey in imageKeys
|
||||||
|
|
|
@ -43,7 +43,6 @@
|
||||||
"passport": "0.1.x",
|
"passport": "0.1.x",
|
||||||
"passport-local": "0.1.x",
|
"passport-local": "0.1.x",
|
||||||
"moment": "~2.5.0",
|
"moment": "~2.5.0",
|
||||||
"mongodb": "1.2.x",
|
|
||||||
"mongoose": "3.8.x",
|
"mongoose": "3.8.x",
|
||||||
"request": "2.12.x",
|
"request": "2.12.x",
|
||||||
"tv4": "~1.0.16",
|
"tv4": "~1.0.16",
|
||||||
|
|
|
@ -34,6 +34,7 @@ ThangTypeHandler = class ThangTypeHandler extends Handler
|
||||||
'extendedName'
|
'extendedName'
|
||||||
'unlockLevelName'
|
'unlockLevelName'
|
||||||
'tasks'
|
'tasks'
|
||||||
|
'terrains'
|
||||||
]
|
]
|
||||||
|
|
||||||
hasAccess: (req) ->
|
hasAccess: (req) ->
|
||||||
|
|
|
@ -210,7 +210,7 @@ describe 'Achieving Achievements', ->
|
||||||
joe2.save (err, joe3) ->
|
joe2.save (err, joe3) ->
|
||||||
expect(err).toBeNull()
|
expect(err).toBeNull()
|
||||||
User.findById(joe3.get('_id')).exec (err, joe4) ->
|
User.findById(joe3.get('_id')).exec (err, joe4) ->
|
||||||
expect(joe4.get('earned').gems).toBe(4) # ... this sometimes gives 4, sometimes 2. Race condition?
|
#expect(joe4.get('earned').gems).toBe(4) # ... this sometimes gives 4, sometimes 2. Race condition? TODO
|
||||||
done()
|
done()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ describe '/db/payment', ->
|
||||||
request = require 'request'
|
request = require 'request'
|
||||||
paymentURL = getURL('/db/payment')
|
paymentURL = getURL('/db/payment')
|
||||||
checkChargesURL = getURL('/db/payment/check-stripe-charges')
|
checkChargesURL = getURL('/db/payment/check-stripe-charges')
|
||||||
|
|
||||||
firstApplePayment = {
|
firstApplePayment = {
|
||||||
apple: {
|
apple: {
|
||||||
rawReceipt: testReceipt
|
rawReceipt: testReceipt
|
||||||
|
@ -15,7 +15,7 @@ describe '/db/payment', ->
|
||||||
localPrice: '$5.00'
|
localPrice: '$5.00'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
secondApplePayment = {
|
secondApplePayment = {
|
||||||
apple: {
|
apple: {
|
||||||
rawReceipt: testReceipt
|
rawReceipt: testReceipt
|
||||||
|
@ -23,7 +23,7 @@ describe '/db/payment', ->
|
||||||
localPrice: '$10.00'
|
localPrice: '$10.00'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
paymentCreated = null
|
paymentCreated = null
|
||||||
|
|
||||||
it 'clears the db first', (done) ->
|
it 'clears the db first', (done) ->
|
||||||
|
@ -32,13 +32,13 @@ describe '/db/payment', ->
|
||||||
done()
|
done()
|
||||||
|
|
||||||
describe 'posting Apple IAPs', ->
|
describe 'posting Apple IAPs', ->
|
||||||
|
|
||||||
it 'denies anonymous users trying to pay', (done) ->
|
it 'denies anonymous users trying to pay', (done) ->
|
||||||
request.get getURL('/auth/whoami'), ->
|
request.get getURL('/auth/whoami'), ->
|
||||||
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
||||||
expect(res.statusCode).toBe 403
|
expect(res.statusCode).toBe 403
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it 'creates a payment object and credits gems to the user', (done) ->
|
it 'creates a payment object and credits gems to the user', (done) ->
|
||||||
loginJoe ->
|
loginJoe ->
|
||||||
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
||||||
|
@ -48,7 +48,7 @@ describe '/db/payment', ->
|
||||||
expect(user.get('purchased').gems).toBe(5000)
|
expect(user.get('purchased').gems).toBe(5000)
|
||||||
done()
|
done()
|
||||||
)
|
)
|
||||||
|
|
||||||
it 'is idempotent', (done) ->
|
it 'is idempotent', (done) ->
|
||||||
loginJoe ->
|
loginJoe ->
|
||||||
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
request.post {uri: paymentURL, json: firstApplePayment}, (err, res, body) ->
|
||||||
|
@ -74,7 +74,7 @@ describe '/db/payment', ->
|
||||||
expect(user.get('purchased').gems).toBe(16000)
|
expect(user.get('purchased').gems).toBe(16000)
|
||||||
done()
|
done()
|
||||||
)
|
)
|
||||||
|
|
||||||
describe 'posting Stripe purchases', ->
|
describe 'posting Stripe purchases', ->
|
||||||
|
|
||||||
stripe = require('stripe')(config.stripe.secretKey)
|
stripe = require('stripe')(config.stripe.secretKey)
|
||||||
|
@ -121,7 +121,7 @@ describe '/db/payment', ->
|
||||||
done()
|
done()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
it 'ignores repeated purchases', (done) ->
|
it 'ignores repeated purchases', (done) ->
|
||||||
data = { productID: 'gems_5', stripe: { token: stripeTokenID, timestamp: timestamp } }
|
data = { productID: 'gems_5', stripe: { token: stripeTokenID, timestamp: timestamp } }
|
||||||
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
||||||
|
@ -133,7 +133,7 @@ describe '/db/payment', ->
|
||||||
done()
|
done()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
it 'allows a new charge on the existing customer', (done) ->
|
it 'allows a new charge on the existing customer', (done) ->
|
||||||
data = { productID: 'gems_5', stripe: { timestamp: new Date().getTime() } }
|
data = { productID: 'gems_5', stripe: { timestamp: new Date().getTime() } }
|
||||||
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
||||||
|
@ -144,11 +144,11 @@ describe '/db/payment', ->
|
||||||
joeData = user.toObject()
|
joeData = user.toObject()
|
||||||
expect(user.get('purchased').gems).toBe(10000)
|
expect(user.get('purchased').gems).toBe(10000)
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it "updates the customer's card when you submit a new token", (done) ->
|
it "updates the customer's card when you submit a new token", (done) ->
|
||||||
stripe.customers.retrieve joeData.stripe.customerID, (err, customer) ->
|
stripe.customers.retrieve joeData.stripe.customerID, (err, customer) ->
|
||||||
originalCustomerID = customer.id
|
originalCustomerID = customer.id
|
||||||
originalCardID = customer.cards.data[0].id
|
originalCardID = customer.sources.data[0].id
|
||||||
stripe.tokens.create {
|
stripe.tokens.create {
|
||||||
card: { number: '4242424242424242', exp_month: 12, exp_year: 2020, cvc: '123' }
|
card: { number: '4242424242424242', exp_month: 12, exp_year: 2020, cvc: '123' }
|
||||||
}, (err, token) ->
|
}, (err, token) ->
|
||||||
|
@ -159,7 +159,7 @@ describe '/db/payment', ->
|
||||||
joeData = user.toObject()
|
joeData = user.toObject()
|
||||||
expect(joeData.stripe.customerID).toBe(originalCustomerID)
|
expect(joeData.stripe.customerID).toBe(originalCustomerID)
|
||||||
stripe.customers.retrieve joeData.stripe.customerID, (err, customer) ->
|
stripe.customers.retrieve joeData.stripe.customerID, (err, customer) ->
|
||||||
expect(customer.cards.data[0].id).not.toBe(originalCardID)
|
expect(customer.sources.data[0].id).not.toBe(originalCardID)
|
||||||
done()
|
done()
|
||||||
|
|
||||||
it 'clears the db', (done) ->
|
it 'clears the db', (done) ->
|
||||||
|
@ -172,7 +172,7 @@ describe '/db/payment', ->
|
||||||
card: { number: '4242424242424242', exp_month: 12, exp_year: 2020, cvc: '123' }
|
card: { number: '4242424242424242', exp_month: 12, exp_year: 2020, cvc: '123' }
|
||||||
}, (err, token) ->
|
}, (err, token) ->
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
productID: 'gems_5'
|
productID: 'gems_5'
|
||||||
stripe: { token: token.id, timestamp: timestamp }
|
stripe: { token: token.id, timestamp: timestamp }
|
||||||
breakAfterCharging: true
|
breakAfterCharging: true
|
||||||
|
@ -181,11 +181,11 @@ describe '/db/payment', ->
|
||||||
loginJoe (joe) ->
|
loginJoe (joe) ->
|
||||||
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
||||||
expect(res.statusCode).toBe 500
|
expect(res.statusCode).toBe 500
|
||||||
|
|
||||||
data = _.omit data, 'breakAfterCharging'
|
data = _.omit data, 'breakAfterCharging'
|
||||||
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
request.post {uri: paymentURL, json: data }, (err, res, body) ->
|
||||||
expect(res.statusCode).toBe 201
|
expect(res.statusCode).toBe 201
|
||||||
|
|
||||||
Payment.count({}, (err, count) ->
|
Payment.count({}, (err, count) ->
|
||||||
expect(count).toBe(1)
|
expect(count).toBe(1)
|
||||||
User.findById(joe.get('_id'), (err, user) ->
|
User.findById(joe.get('_id'), (err, user) ->
|
||||||
|
@ -199,7 +199,7 @@ describe '/db/payment', ->
|
||||||
clearModels [User, Payment], (err) ->
|
clearModels [User, Payment], (err) ->
|
||||||
throw err if err
|
throw err if err
|
||||||
done()
|
done()
|
||||||
|
|
||||||
# Testing card numbers are here: https://stripe.com/docs/testing
|
# Testing card numbers are here: https://stripe.com/docs/testing
|
||||||
|
|
||||||
it 'handles card that attaches to customer but fails to be charged', (done) ->
|
it 'handles card that attaches to customer but fails to be charged', (done) ->
|
||||||
|
@ -295,4 +295,3 @@ describe '/db/payment', ->
|
||||||
done()
|
done()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -280,10 +280,10 @@ describe 'SearchablePlugin', ->
|
||||||
firstArticle.save (err) ->
|
firstArticle.save (err) ->
|
||||||
throw err if err
|
throw err if err
|
||||||
|
|
||||||
Article.textSearch 'best', {filter: {index: true}}, (err, results) ->
|
Article.find {$text: {$search: 'best'}, index: true}, (err, results) ->
|
||||||
expect(err).toBeNull()
|
expect(err).toBeNull()
|
||||||
if results
|
if results
|
||||||
expect(results.results.length).toBeGreaterThan(0)
|
expect(results.length).toBeGreaterThan(0)
|
||||||
else
|
else
|
||||||
console.log('ERROR:', err)
|
console.log('ERROR:', err)
|
||||||
done()
|
done()
|
||||||
|
|
Loading…
Reference in a new issue