add flagging and unflagging tests to response show view

This commit is contained in:
Your Name
2013-05-17 09:52:02 -04:00
parent ad5b71deae
commit 6fb8adaa50

View File

@@ -49,3 +49,14 @@ describe 'ResponseCommentShowView', ->
it 'produces the correct HTML', ->
@view.render()
expect(@view.el.innerHTML).toContain('"discussion-flag-abuse notflagged"')
it 'can be flagged for abuse', ->
@response.flagAbuse()
expect(@response.get 'abuse_flaggers').toEqual ['123', '567']
it 'can be unflagged for abuse', ->
temp_array = []
temp_array.push(window.user.get('id'))
@response.set("abuse_flaggers",temp_array)
@response.unflagAbuse()
expect(@response.get 'abuse_flaggers').toEqual []