gitlab-org--gitlab-foss/spec/javascripts/issue_spec.js.coffee

23 lines
721 B
CoffeeScript
Raw Normal View History

2015-05-04 23:06:57 -04:00
#= require issue
describe 'Issue', ->
describe 'task lists', ->
fixture.preload('issues_show.html')
2015-05-04 23:06:57 -04:00
beforeEach ->
fixture.load('issues_show.html')
2015-05-04 23:06:57 -04:00
@issue = new Issue()
it 'modifies the Markdown field', ->
2015-05-06 17:02:14 -04:00
spyOn(jQuery, 'ajax').and.stub()
$('input[type=checkbox]').attr('checked', true).trigger('change')
expect($('.js-task-list-field').val()).toBe('- [x] Task List Item')
2015-05-04 23:06:57 -04:00
it 'submits an ajax request on tasklist:changed', ->
2015-05-06 17:02:14 -04:00
spyOn(jQuery, 'ajax').and.callFake (req) ->
2015-05-04 23:06:57 -04:00
expect(req.type).toBe('PATCH')
expect(req.url).toBe('/foo')
expect(req.data.issue.description).not.toBe(null)
$('.js-task-list-field').trigger('tasklist:changed')