VRFS-2700 got tests running, except adding

This commit is contained in:
Jonathan Kolyer 2015-02-16 01:59:43 +00:00
parent c44c94671a
commit c5bd550597
1 changed files with 17 additions and 9 deletions

View File

@ -29,23 +29,31 @@ describe "RecordingSource", ->
@recSource.siteIsValid()
expect(@recSource.checkmark).toBeVisible()
xit "initializes sources properly", ->
expect(@recSource.hasSources()).toEqual(true)
it "initializes sources properly", ->
expect(@recSource.recording_sources.length).toEqual(1)
xit "adds source entries properly", ->
@url += 'xx'
@url = "https://www.youtube.com/watch?v=_wYtG7aQTHA"
@server.respondWith("GET", '/api/data_validation?sitetype=rec_youtube&data=' + encodeURIComponent(@url),
[200, { "content-type": "application/json" }, JSON.stringify({"message": "Valid Site", "data": @url, "recording_id" : "_wYtG7aQTHA"})])
sinon.spy()
@recSource.data_input.val(@url)
@recSource.add_btn.click()
@server.respond()
expect(@recSource.state().state()).toEqual('resolved')
expect(@server.containsRecordingUrl(@url)).toEqual(true)
it "rejects duplicate source entries", ->
rec_src_len = @recSource.recording_sources.length
@server.respondWith("GET", '/api/data_validation?sitetype=url&data=' + encodeURIComponent(@url),
[200, { "content-type": "application/json" }, JSON.stringify({"message": "Valid Site"})])
sinon.spy()
@recSource.data_input.val(@url)
@recSource.add_btn.click()
@server.respond()
expect(@siteValidator.state().state()).toEqual('resolved')
expect(@server.containsRecordingUrl(@url)).toEqual(true)
expect(@recSource.state().state()).toEqual('pending')
expect(@recSource.recording_sources.length).toEqual(rec_src_len)
xit "rejects duplicate source entries", ->
xit "removes sources", ->
it "removes sources", ->
expect(@recSource.removeRecordingId('i_xFOmYxKYz')).toEqual(true)