Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update acceptance specs to reflect changes

  • Loading branch information...
commit b8f22d9f9e531e05286d611ca2e000f3cbece9f6 1 parent 31aaf14
@esposito esposito authored
View
2  spec/javascripts/z-acceptance/presync/presync_conflict_spec.coffee
@@ -57,7 +57,7 @@ describe 'presync_conflict', ->
@collection.preSync()
waitsFor (->
@updateSpy.callCount >= 4 and @secondUpdateSpy.callCount >= 2
- ), 'update unicast and multicast', 1000
+ ), 'update multicast', 1000
it 'is not received by an offline client', ->
expect(_.first(@secondCollection.models).get('title')).toEqual('some_title')
View
14 spec/javascripts/z-acceptance/sync/sync_conflict_spec.coffee
@@ -38,7 +38,7 @@ describe 'sync_conflict', ->
@collection.syncModels()
# wait until model is successfully synced to all clients
waitsFor (->
- @createSpy.callCount > 0 and @secondCreateSpy.callCount > 0
+ @createSpy.callCount >= 1 and @secondCreateSpy.callCount >= 1
), 'create multicast', 1000
runs ->
# make sure the second client misses the first client update
@@ -55,17 +55,14 @@ describe 'sync_conflict', ->
title: 'other_title'
@collection.syncModels()
waitsFor (->
- @updateSpy.callCount > 3
- ), 'update unicast', 1000
+ @updateSpy.callCount >= 2 and @secondUpdateSpy.callCount >= 2
+ ), 'update multicast', 1000
it 'is not received by an offline client', ->
expect(_.first(@secondCollection.models).get('title')).toEqual('some_title')
context 'and another client updates the same model and syncs it', ->
beforeEach ->
- waitsFor (->
- @secondUpdateSpy.callCount > 1
- ), 'update multicast', 1000
# take the second client back online
@secondCollection.fayeClient._online()
# create a conflicting update and sync it
@@ -73,12 +70,9 @@ describe 'sync_conflict', ->
content: 'other_content'
@secondCollection.syncModels()
waitsFor (->
- @updateSpy.callCount > 5 and @secondUpdateSpy.callCount > 5
+ @updateSpy.callCount >= 3 and @secondUpdateSpy.callCount >= 4
), 'update unicast', 1000
- # it 'receives an empty update unicast', ->
- # expect(@secondUpdateSpy).toHaveBeenCalledWith({})
-
# it 'reflects the first update', ->
# expect(@model.get('title')).toEqual('other_title')
View
5 spec/javascripts/z-acceptance/sync/sync_create_spec.coffee
@@ -51,7 +51,7 @@ describe 'sync_create', ->
beforeEach ->
@collection.syncModels()
waitsFor (->
- @createSpy.callCount > 0 and @secondCreateSpy.callCount > 0
+ @createSpy.callCount >= 1 and @secondCreateSpy.callCount >= 1
), 'create multicast', 1000
# it 'receives a create multicast', ->
@@ -62,9 +62,6 @@ describe 'sync_create', ->
it 'is forwarded to its last version', ->
expect(@model.hasPatches()).toBeFalsy()
-
- # it 'receives an empty resolve unicast', ->
- # expect(@resolveSpy).toHaveBeenCalledWith([])
it 'exists on another client', ->
expect(_.first(@secondCollection.models).toJSON())
View
7 spec/javascripts/z-acceptance/sync/sync_update_spec.coffee
@@ -35,7 +35,7 @@ describe 'sync_update', ->
@collection.create @model
@collection.syncModels()
waitsFor (->
- @createSpy.callCount > 0
+ @createSpy.callCount >= 1
), 'create multicast', 1000
afterEach ->
@@ -55,7 +55,7 @@ describe 'sync_update', ->
beforeEach ->
@collection.syncModels()
waitsFor (->
- @updateSpy.callCount > 3 and @secondUpdateSpy.callCount > 1
+ @updateSpy.callCount >= 2 and @secondUpdateSpy.callCount >= 2
), 'update multicast', 1000
# it 'receives an update multicast', ->
@@ -64,9 +64,6 @@ describe 'sync_update', ->
it 'is forwarded to its last version', ->
expect(@model.hasPatches()).toBeFalsy()
- # it 'received an empty update unicast', ->
- # expect(@updateSpy).toHaveBeenCalledWith({})
-
it 'is updated on another client', ->
expect(_.first(@secondCollection.models).toJSON())
.toEqual(@model.toJSON())
Please sign in to comment.
Something went wrong with that request. Please try again.