From 296a8781691ed46b4a0681da60a4306ecab3317f Mon Sep 17 00:00:00 2001 From: Your Name <kevinchugh@edx.org> Date: Fri, 17 May 2013 09:31:12 -0400 Subject: [PATCH] add flagging tests to DiscussionContentView --- common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee b/common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee index 217f441..add9de7 100644 --- a/common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee +++ b/common/static/coffee/spec/discussion/view/discussion_content_view_spec.coffee @@ -2,24 +2,26 @@ describe "DiscussionContentView", -> beforeEach -> setFixtures - """ - <div class="discussion-post"> - <header> - <a data-tooltip="vote" data-role="discussion-vote" class="vote-btn discussion-vote discussion-vote-up" href="#"> - <span class="plus-icon">+</span> <span class="votes-count-number">0</span></a> - <h1>Post Title</h1> - <p class="posted-details"> - <a class="username" href="/courses/MITx/999/Robot_Super_Course/discussion/forum/users/1">robot</a> - <span title="2013-05-08T17:34:07Z" class="timeago">less than a minute ago</span> - </p> - </header> - <div class="post-body"><p>Post body.</p></div> - <div data-tooltip="Report Misuse" data-role="thread-flag" class="discussion-flag-abuse notflagged"> - <i class="icon"></i><span class="flag-label">Report Misuse</span></div> - <div data-tooltip="pin this thread" data-role="thread-pin" class="admin-pin discussion-pin notpinned"> - <i class="icon"></i><span class="pin-label">Pin Thread</span></div> - </div> - """ + ( + """ + <div class="discussion-post"> + <header> + <a data-tooltip="vote" data-role="discussion-vote" class="vote-btn discussion-vote discussion-vote-up" href="#"> + <span class="plus-icon">+</span> <span class="votes-count-number">0</span></a> + <h1>Post Title</h1> + <p class="posted-details"> + <a class="username" href="/courses/MITx/999/Robot_Super_Course/discussion/forum/users/1">robot</a> + <span title="2013-05-08T17:34:07Z" class="timeago">less than a minute ago</span> + </p> + </header> + <div class="post-body"><p>Post body.</p></div> + <div data-tooltip="Report Misuse" data-role="thread-flag" class="discussion-flag-abuse notflagged"> + <i class="icon"></i><span class="flag-label">Report Misuse</span></div> + <div data-tooltip="pin this thread" data-role="thread-pin" class="admin-pin discussion-pin notpinned"> + <i class="icon"></i><span class="pin-label">Pin Thread</span></div> + </div> + """) + @thread = new Thread { id: '01234567', user_id: '567', @@ -47,10 +49,9 @@ describe "DiscussionContentView", -> @thread.flagAbuse() expect(@thread.get 'abuse_flaggers').toEqual ['123', '567'] - it 'can be unflagged for abuse', -> - temp_array = [] - temp_array.push(window.user.get('id')) - @thread.set("abuse_flaggers",temp_array) - @thread.unflagAbuse() - expect(@thread.get 'abuse_flaggers').toEqual [] - \ No newline at end of file + it 'can be unflagged for abuse', -> + temp_array = [] + temp_array.push(window.user.get('id')) + @thread.set("abuse_flaggers",temp_array) + @thread.unflagAbuse() + expect(@thread.get 'abuse_flaggers').toEqual [] -- libgit2 0.26.0