Skip to content

Commit

Permalink
Creating uninstall method tests #22
Browse files Browse the repository at this point in the history
  • Loading branch information
danielalves committed Mar 9, 2015
1 parent 87f2d29 commit afa5ba3
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions spec/javascripts/CoreSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,32 @@ describe("$.silverTrack", function() {
});
});

describe("#uninstall", function() {
beforeEach(function() {
track = helpers.basic();
});

it("should remove the plugin", function() {
track.install(plugin);
expect(track.plugins.indexOf(plugin)).not.toBe(-1);

track.uninstall(plugin);
expect(track.plugins.indexOf(plugin)).toBe(-1);
});

it("should call 'onUninstall'", function() {
spyOn(plugin, "onUninstall");
track.install(plugin);
track.uninstall(plugin);
expect(plugin.onUninstall).toHaveBeenCalledWith(track);
});

it("should return the silverTrack instance", function() {
track.install(plugin);
expect(track.uninstall(plugin)).toBe(track);
});
});

describe("#findPluginByName", function() {
var plugin1, plugin2;

Expand Down

0 comments on commit afa5ba3

Please sign in to comment.