Commit 10ca0a38 by Andy Armstrong Committed by Eric Fischer

Discussion Test Updates

Updates discussion tests to not mock out so much. Also adds new
test coverage for the bug being investigated here.
parent 40ff300e
......@@ -14,6 +14,12 @@ class @DiscussionViewSpecHelper
body: "",
title: "dummy title",
created_at: "2014-08-18T01:02:03Z"
ability: {
can_delete: false,
can_reply: true,
can_vote: false,
editable: false,
}
}
$.extend(thread, props)
......@@ -72,7 +78,7 @@ class @DiscussionViewSpecHelper
spy.reset()
button.trigger($.Event("keydown", {which: 32}))
expect(spy).toHaveBeenCalled()
@checkVoteButtonEvents = (view) ->
@checkButtonEvents(view, "toggleVote", ".action-vote")
......
if Backbone?
class @DiscussionContentView extends Backbone.View
events:
"click .discussion-flag-abuse": "toggleFlagAbuse"
"keydown .discussion-flag-abuse":
(event) -> DiscussionUtil.activateOnSpace(event, @toggleFlagAbuse)
attrRenderer:
ability: (ability) ->
for action, selector of @abilityRenderer
......@@ -56,7 +56,7 @@ if Backbone?
setWmdContent: (cls_identifier, text) =>
DiscussionUtil.setWmdContent @$el, $.proxy(@$, @), cls_identifier, text
initialize: ->
@model.bind('change', @renderPartialAttrs, @)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment