diff options
-rw-r--r-- | app/assets/javascripts/issue.js.coffee | 2 | ||||
-rw-r--r-- | spec/javascripts/issue_spec.js.coffee | 11 |
2 files changed, 3 insertions, 10 deletions
diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index 1423daa281b..2e0ef99a587 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -27,6 +27,7 @@ class @Issue url: url, error: (jqXHR, textStatus, errorThrown) -> issueStatus = if isClose then 'close' else 'open' + new Flash("Issues update failed", 'alert') success: (data, textStatus, jqXHR) -> if data.saved $this.addClass('hidden') @@ -39,6 +40,7 @@ class @Issue $('div.issue-box-closed').addClass('hidden') $('div.issue-box-open').removeClass('hidden') else + new Flash("Issues update failed", 'alert') $this.prop('disabled', false) disableTaskList: -> diff --git a/spec/javascripts/issue_spec.js.coffee b/spec/javascripts/issue_spec.js.coffee index f50640d1821..ef78cfbc653 100644 --- a/spec/javascripts/issue_spec.js.coffee +++ b/spec/javascripts/issue_spec.js.coffee @@ -31,41 +31,32 @@ describe 'reopen/close issue', -> expect(obj.url).toBe('http://gitlab/issues/6/close') obj.success saved: true - # setup $btnClose = $('a.btn-close') $btnReopen = $('a.btn-reopen') expect($btnReopen.toBeHidden()) expect($btnClose.text()).toBe('Close') expect(typeof $btnClose.prop('disabled')).toBe('undefined') - # excerize $btnClose.trigger('click') - # verify expect($btnClose.toBeHidden()) expect($btnReopen.toBeVisible()) expect($('div.issue-box-open').toBeVisible()) expect($('div.issue-box-closed').toBeHidden()) - # teardown it 'reopens an issue', -> $.ajax = (obj) -> expect(obj.type).toBe('PUT') expect(obj.url).toBe('http://gitlab/issues/6/reopen') obj.success saved: true - # setup $btnClose = $('a.btn-close') $btnReopen = $('a.btn-reopen') expect($btnReopen.text()).toBe('Reopen') - # excerize $btnReopen.trigger('click') - # verify expect($btnReopen.toBeHidden()) expect($btnClose.toBeVisible()) expect($('div.issue-box-open').toBeVisible()) - expect($('div.issue-box-closed').toBeHidden()) - - # teardown
\ No newline at end of file + expect($('div.issue-box-closed').toBeHidden())
\ No newline at end of file |