Skip to content

Commit

Permalink
added new jasmine specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jkaipr committed Mar 30, 2016
1 parent 3af1ea4 commit 902a728
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/dummy/spec/javascripts/alert_spec.js.es6
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
describe("BBCrud.Alert", () => {
it("BBCrud.Alert is defined", () => {
expect(BBCrud.Alert).toBeDefined();
expect(BBCrud.Alert.init).toBeDefined();
expect(BBCrud.Alert.show).toBeDefined();
expect(BBCrud.Alert.hide).toBeDefined();
});
});
7 changes: 7 additions & 0 deletions test/dummy/spec/javascripts/modals_spec.js.es6
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
describe("BBCrud.Modals", () => {
it("BBCrud.Modals is defined", () => {
expect(BBCrud.Modals).toBeDefined();
expect(BBCrud.Modals.create).toBeDefined();
expect(BBCrud.Modals.update).toBeDefined();
expect(BBCrud.Modals.show).toBeDefined();
expect(BBCrud.Modals.delete).toBeDefined();
expect(BBCrud.Modals.form).toBeDefined();
expect(BBCrud.Modals.other).toBeDefined();
expect(BBCrud.Modals.initBtnHandler).toBeDefined();
});
});
20 changes: 20 additions & 0 deletions test/dummy/spec/javascripts/models_spec.js.es6
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
describe("BBCrud.Models", () => {
it("BBCrud.Models is defined", () => {
expect(BBCrud.Models).toBeDefined();
expect(BBCrud.Models.add).toBeDefined();
expect(BBCrud.Models.addAction).toBeDefined();
});
});

describe("BBCrud.Models.add", () => {
it("Creates new model object on BBCrud.Models", () => {
BBCrud.Models.add('Box', '/boxes/', 'box');
expect(BBCrud.Models.Box).toBeDefined();
expect(BBCrud.Models.Box.create).toBeDefined();
expect(BBCrud.Models.Box.update).toBeDefined();
expect(BBCrud.Models.Box.show).toBeDefined();
});
});

describe("BBCrud.Models.addAction", () => {
it("Creates a new model, if it wasn't previously defined and adds a function to it", () => {
BBCrud.Models.addAction('Sphere', '/spheres/', 'sphere', 'tessellate');
expect(BBCrud.Models.Sphere).toBeDefined();
expect(BBCrud.Models.Sphere.tessellate).toBeDefined();
});
});

0 comments on commit 902a728

Please sign in to comment.