Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Merge pull request #55 from theonion/adscanceled
Browse files Browse the repository at this point in the history
Fixes for the vast plugin, against our branch of videojs-contrib-ads
  • Loading branch information
csinchok committed Nov 18, 2014
2 parents a61fc1b + ffe84c0 commit ebe59f0
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 244 deletions.
2 changes: 0 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ var specs = "spec/*Spec.js",

var _ = require('lodash');

var desireds = require('./spec/desireds.js');

var gruntConfig = {
env: {
// dynamically filled
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"dependencies": {
"videojs": "4.4.3",
"vast-client-js": "1.1.2",
"videojs-contrib-ads": "0.4.0"
"videojs-contrib-ads": "0.5.0"
}
}
23 changes: 12 additions & 11 deletions spec/VastPluginSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ describe('videojs.vast plugin', function() {
}
})();
player = videojs(id);
player.ads();
player.vast({
url: ""
});
// player.ads();
// player.vast({
// url: ""
// });
});


Expand Down Expand Up @@ -70,11 +70,11 @@ describe('videojs.vast plugin', function() {
});

it("should bail out if no url is provided", function() {
spyOn(this.p, "trigger");
this.p.ads();
var result = this.p.vast({});
expect(result).toBe(null);
expect(this.p.trigger).toHaveBeenCalledWith("adtimeout");
spyOn(this.p, "trigger").and.callThrough();
this.p.trigger('readyforpreroll');
expect(this.p.trigger).toHaveBeenCalledWith("adscanceled");
});

it("should request an ad if a source is already loaded", function() {
Expand Down Expand Up @@ -122,6 +122,7 @@ describe('videojs.vast plugin', function() {
describe("tearDown", function() {

it("should end the linear ad", function() {
player.ads();
player.vast({ url: 'balhbahblhab' });

spyOn(player.ads, "endLinearAdMode");
Expand All @@ -143,6 +144,7 @@ describe('videojs.vast plugin', function() {
describe("preroll", function() {

beforeEach(function() {
player.ads();
player.vast({ url: 'balhbahblhab' });
player.vastTracker = {
clickThroughURLTemplate: "a whole new page",
Expand All @@ -163,7 +165,7 @@ describe('videojs.vast plugin', function() {
});

it("should end the ad", function() {
spyOn(player, "one");
spyOn(player, "one");
player.vast.preroll();
expect(player.one).toHaveBeenCalledWith("ended", jasmine.any(Function));
});
Expand All @@ -187,7 +189,7 @@ describe('videojs.vast plugin', function() {

spyOn(player, "trigger");
player.vast.getContent("some url");
expect(player.trigger).toHaveBeenCalledWith("adtimeout");
expect(player.trigger).toHaveBeenCalledWith("adscanceled");
});

describe("linear ads", function() {
Expand Down Expand Up @@ -231,11 +233,10 @@ describe('videojs.vast plugin', function() {
expect(DMVAST.util.track).toHaveBeenCalledWith(
jasmine.any(String), jasmine.any(Object)
);
expect(player.trigger).toHaveBeenCalledWith("adtimeout");
expect(player.trigger).toHaveBeenCalledWith("adscanceled");
});
});

});

});
});
82 changes: 0 additions & 82 deletions spec/desireds.js

This file was deleted.

100 changes: 0 additions & 100 deletions spec/sauce-wd.js

This file was deleted.

Loading

0 comments on commit ebe59f0

Please sign in to comment.