diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-06-09 03:27:52 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-06-09 03:37:40 +0300 |
commit | 92af60c2449cae5cbe2a8ef8ea65e973017053c2 (patch) | |
tree | 8c9e0fff46a85f454863bdb52ed2ce2c2f4db7d0 /spec | |
parent | 52525dc4c28750a61697375900830589bb79eaa9 (diff) |
Move award_menu_url variable into gon object.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/awards_handler_spec.js.coffee | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/javascripts/awards_handler_spec.js.coffee b/spec/javascripts/awards_handler_spec.js.coffee index 0bd6d696387..ba191199dc7 100644 --- a/spec/javascripts/awards_handler_spec.js.coffee +++ b/spec/javascripts/awards_handler_spec.js.coffee @@ -3,10 +3,11 @@ #= require jquery.cookie #= require ./fixtures/emoji_menu -awardsHandler = null -window.gl or= {} -gl.emojiAliases = -> return { '+1': 'thumbsup', '-1': 'thumbsdown' } -gl.awardMenuUrl = '/emojis' +awardsHandler = null +window.gl or= {} +window.gon or= {} +gl.emojiAliases = -> return { '+1': 'thumbsup', '-1': 'thumbsdown' } +gon.award_menu_url = '/emojis' lazyAssert = (done, assertFn) -> @@ -25,9 +26,7 @@ describe 'AwardsHandler', -> fixture.load 'awards_handler.html' awardsHandler = new AwardsHandler spyOn(awardsHandler, 'postEmoji').and.callFake (url, emoji, cb) => cb() - spyOn(jQuery, 'get').and.callFake (req, cb) -> - expect(req).toBe '/emojis' - cb window.emojiMenu + spyOn(jQuery, 'get').and.callFake (req, cb) -> cb window.emojiMenu describe '::showEmojiMenu', -> |