Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Monarch is green again. Refactoring to skip lists complete. Is it way…

… slower?
  • Loading branch information...
commit 8b925b0171d02c32aa19a7b102cd19af6b7ffeeb 1 parent 82d167d
@nathansobo authored
Showing with 40 additions and 34 deletions.
  1. +5 −2 spec/monarch/http/server_spec.js
  2. +35 −32 spec/monarch/model/tuple_spec.js
View
7 spec/monarch/http/server_spec.js
@@ -228,7 +228,9 @@ Screw.Unit(function(c) { with(c) {
});
var afterEventsCallback = mockFunction("after events", function() {
- expect(tableInsertCallback).to(haveBeenCalled, withArgs(record));
+ var sortKey = User.table.buildSortKey(record);
+
+ expect(tableInsertCallback).to(haveBeenCalled, withArgs(record, 1, sortKey, sortKey));
expect(recordCreateCallback).to(haveBeenCalled, withArgs(record));
expect(record.afterRemoteCreate).to(haveBeenCalled, once);
@@ -357,7 +359,8 @@ Screw.Unit(function(c) { with(c) {
expect(record.valid()).to(beTrue);
- expect(tableRemoteUpdateCallback).to(haveBeenCalled, withArgs(record, expectedChangset));
+ var sortKey = Blog.table.buildSortKey(record);
+ expect(tableRemoteUpdateCallback).to(haveBeenCalled, withArgs(record, expectedChangset, 1, 1, sortKey, sortKey));
expect(recordRemoteUpdateCallback).to(haveBeenCalled, withArgs(expectedChangset));
expect(record.afterRemoteUpdate).to(haveBeenCalled, withArgs(expectedChangset));
View
67 spec/monarch/model/tuple_spec.js
@@ -1,38 +1,41 @@
//= require "../../monarch_spec_helper"
Screw.Unit(function(c) { with(c) {
- describe("Monarch.Model.Tuple", function() {
- useLocalFixtures();
-
- describe("#hashCode()", function() {
- var relation;
- before(function() {
- });
- var aProjection, bProjection;
+// projections have been removed for now. this method is not needed until we have them
- before(function() {
- _.constructor("A", Monarch.Model.Record);
- A.columns({ a: "string", b: "string", c: "string", d: "string" });
- _.constructor("B", Monarch.Model.Record);
- B.columns({ a: "string", b: "string", c: "string", d: "string" });
- A.create({ a: '1', b: '2', c: '3', d: '4' });
- B.create({ a: '1', b: '2', c: '3', d: '4' });
-
- aProjection = A.project(A.a, A.b, A.d);
- bProjection = B.project(B.a, B.b, B.d);
- });
-
- after(function() {
- delete window.A;
- delete window.B;
- delete Repository.tables.as;
- delete Repository.tables.bs;
- });
-
- it("returns an md5 digest of a canonical ordering of its column-value pairs", function() {
- expect(aProjection.first().hashCode()).to(eq, bProjection.first().hashCode());
- });
- });
- });
+// describe("Monarch.Model.Tuple", function() {
+// useLocalFixtures();
+//
+// describe("#hashCode()", function() {
+// var relation;
+// before(function() {
+// });
+//
+// var aProjection, bProjection;
+//
+// before(function() {
+// _.constructor("A", Monarch.Model.Record);
+// A.columns({ a: "string", b: "string", c: "string", d: "string" });
+// _.constructor("B", Monarch.Model.Record);
+// B.columns({ a: "string", b: "string", c: "string", d: "string" });
+// A.create({ a: '1', b: '2', c: '3', d: '4' });
+// B.create({ a: '1', b: '2', c: '3', d: '4' });
+//
+// aProjection = A.project(A.a, A.b, A.d);
+// bProjection = B.project(B.a, B.b, B.d);
+// });
+//
+// after(function() {
+// delete window.A;
+// delete window.B;
+// delete Repository.tables.as;
+// delete Repository.tables.bs;
+// });
+//
+// it("returns an md5 digest of a canonical ordering of its column-value pairs", function() {
+// expect(aProjection.first().hashCode()).to(eq, bProjection.first().hashCode());
+// });
+// });
+// });
}});
Please sign in to comment.
Something went wrong with that request. Please try again.