summaryrefslogtreecommitdiff
path: root/web-ui/test/spec/tags/data/tags.spec.js
diff options
context:
space:
mode:
authorDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 12:17:18 +0200
committerDuda Dornelles <ddornell@thoughtworks.com>2014-10-20 12:32:06 +0200
commit495bc391e140cc2bb462c81fa90410a0fe8f6a4c (patch)
tree5c141e2fcaefd508acf407267bb23807d46710a9 /web-ui/test/spec/tags/data/tags.spec.js
parentb74a39f27c292cc95345b7ab266bb3db2f812a66 (diff)
massive update of bower and npm libs - includes flight, jasmine and a bunch of
stuff. If things get weird when developing, remove you bower_components and your node_modules and install it again
Diffstat (limited to 'web-ui/test/spec/tags/data/tags.spec.js')
-rw-r--r--web-ui/test/spec/tags/data/tags.spec.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/web-ui/test/spec/tags/data/tags.spec.js b/web-ui/test/spec/tags/data/tags.spec.js
index 41821366..e42a7752 100644
--- a/web-ui/test/spec/tags/data/tags.spec.js
+++ b/web-ui/test/spec/tags/data/tags.spec.js
@@ -4,20 +4,20 @@ describeComponent('tags/data/tags', function () {
'use strict';
beforeEach(function () {
- setupComponent();
+ this.setupComponent();
});
it('asks the server for tags when receiving the tags:want event', function() {
- spyOn($, 'ajax').andReturn({done: function() {}});
+ spyOn($, 'ajax').and.returnValue({done: function() {}});
this.component.trigger(Pixelated.events.tags.want);
- expect($.ajax.mostRecentCall.args[0]).toEqual('/tags');
+ expect($.ajax.calls.mostRecent().args[0]).toEqual('/tags');
});
it('triggers an event on the initial sender after receiving tags', function() {
var f;
- spyOn($, 'ajax').andReturn({done: function(d) { f = d; }});
+ spyOn($, 'ajax').and.returnValue({done: function(d) { f = d; }});
var me = {};
var eventSpy = spyOnEvent(me, Pixelated.events.tags.received);
@@ -29,13 +29,13 @@ describeComponent('tags/data/tags', function () {
it('triggers an event containing the returned tags', function() {
var f;
- spyOn($, 'ajax').andReturn({done: function(d) { f = d; }});
+ spyOn($, 'ajax').and.returnValue({done: function(d) { f = d; }});
var me = {};
var eventSpy = spyOnEvent(me, Pixelated.events.tags.received);
this.component.trigger(Pixelated.events.tags.want, { caller: me });
var tags = ['foo', 'bar', 'quux/bar'];
f(tags);
tags.push(this.component.all);
- expect(eventSpy.mostRecentCall.data).toEqual({tags: tags});
+ expect(eventSpy.mostRecentCall.data).toEqual(jasmine.objectContaining({tags: tags}));
});
});