fixes ajax issue with issue spec

This commit is contained in:
Jacob Schatz 2016-01-07 12:27:01 -05:00
parent 0d59e7b90f
commit 8f6ca70055
2 changed files with 22 additions and 22 deletions

View File

@ -443,6 +443,10 @@ GEM
omniauth (1.2.2)
hashie (>= 1.2, < 4)
rack (~> 1.0)
omniauth-azure-oauth2 (0.0.6)
jwt (~> 1.0)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)
omniauth-bitbucket (0.0.2)
multi_json (~> 1.7)
omniauth (~> 1.1)
@ -488,10 +492,6 @@ GEM
activesupport
nokogiri (>= 1.4.4)
omniauth (~> 1.0)
omniauth-azure-oauth2 (0.0.6)
jwt (~> 1.0)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)
opennebula (4.14.2)
json
nokogiri
@ -920,6 +920,7 @@ DEPENDENCIES
oauth2 (~> 1.0.0)
octokit (~> 3.7.0)
omniauth (~> 1.2.2)
omniauth-azure-oauth2
omniauth-bitbucket (~> 0.0.2)
omniauth-cas3 (~> 1.1.2)
omniauth-facebook (~> 3.0.0)
@ -931,7 +932,6 @@ DEPENDENCIES
omniauth-shibboleth (~> 1.2.0)
omniauth-twitter (~> 1.2.0)
omniauth_crowd
omniauth-azure-oauth2
org-ruby (~> 0.9.12)
paranoia (~> 2.0)
pg (~> 0.18.2)
@ -999,4 +999,4 @@ DEPENDENCIES
wikicloth (= 0.8.1)
BUNDLED WITH
1.10.6
1.11.2

View File

@ -26,10 +26,10 @@ describe 'reopen/close issue', ->
fixture.load('issues_show.html')
@issue = new Issue()
it 'closes an issue', ->
$.ajax = (obj) ->
expect(obj.type).toBe('PUT')
expect(obj.url).toBe('http://gitlab.com/issues/6/close')
obj.success saved: true
spyOn(jQuery, 'ajax').and.callFake (req) ->
expect(req.type).toBe('PUT')
expect(req.url).toBe('http://gitlab.com/issues/6/close')
req.success saved: true
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
@ -46,10 +46,10 @@ describe 'reopen/close issue', ->
it 'fails to closes an issue with success:false', ->
$.ajax = (obj) ->
expect(obj.type).toBe('PUT')
expect(obj.url).toBe('http://goesnowhere.nothing/whereami')
obj.success saved: false
spyOn(jQuery, 'ajax').and.callFake (req) ->
expect(req.type).toBe('PUT')
expect(req.url).toBe('http://goesnowhere.nothing/whereami')
req.success saved: false
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
@ -69,10 +69,10 @@ describe 'reopen/close issue', ->
it 'fails to closes an issue with HTTP error', ->
$.ajax = (obj) ->
expect(obj.type).toBe('PUT')
expect(obj.url).toBe('http://goesnowhere.nothing/whereami')
obj.error()
spyOn(jQuery, 'ajax').and.callFake (req) ->
expect(req.type).toBe('PUT')
expect(req.url).toBe('http://goesnowhere.nothing/whereami')
req.error()
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')
@ -91,10 +91,10 @@ describe 'reopen/close issue', ->
expect($('div.flash-alert').text()).toBe('Unable to update this issue at this time.')
it 'reopens an issue', ->
$.ajax = (obj) ->
expect(obj.type).toBe('PUT')
expect(obj.url).toBe('http://gitlab.com/issues/6/reopen')
obj.success saved: true
spyOn(jQuery, 'ajax').and.callFake (req) ->
expect(req.type).toBe('PUT')
expect(req.url).toBe('http://gitlab.com/issues/6/reopen')
req.success saved: true
$btnClose = $('a.btn-close')
$btnReopen = $('a.btn-reopen')