Home Manual Reference Source Test

Test

Description Identifier Count

should return the queries for creating the table and the primary unique index

-

should correctly create join tables for models that have queryable collections

-

should use the correct column type for each attribute

-

the setup method should return these queries

-

should not fail if additional config is present, but setup is undefined

-

should pass the provided predicates on to the ModelQuery

-

should return a ModelQuery ready to be executed

-

should pass the provided predicates on to the ModelQuery

-

should return a ModelQuery ready to be executed

-

should pass the provided predicates on to the ModelQuery

-

should return a ModelQuery configured for COUNT ready to be executed

-

calls the provided function inside an exclusive transaction

-

preserves resolved values

-

always fires a COMMIT, even if the body function fails

-

can be called multiple times and get queued

-

carries on if one of them fails, but still calls the COMMIT for the failed block

-

is actually running in series and blocks on never-finishing specs

-

can be called multiple times and preserve return values

-

can be called multiple times and get queued

-

should throw an exception if the model is not a subclass of Model

-

should call through to persistModels

-

should call transactionDidCommitChanges with a change that contains the models

-

should call through to _writeModels after checking them

-

should throw an exception if the models are not the same class, since it cannot be specified by the trigger payload

-

should throw an exception if the models are not a subclass of Model

-

should run pre-mutation hooks, wait to write models, and then run post-mutation hooks

-

should carry on if a pre-mutation hook throws

-

should carry on if a pre-mutation hook rejects

-

should delete the model by id

-

should call transactionDidCommitChanges with a change that contains the model

-

should compose a REPLACE INTO query to save the model

-

should save the model JSON into the data column

-

should populate additional columns defined by the attributes

-

should use the JSON-form values of the queryable attributes

-

should delete all association records for the model from join tables

-

should insert new association records into join tables in a single query, and include queryableBy columns

-

should page association records into multiple queries correctly

-

should page association records into multiple queries correctly

-

should page association records into multiple queries correctly

-

should not include the value to the joined attribute in the JSON written to the main model table

-

should write the value to the joined table if it is defined

-

should not write the value to the joined table if it undefined

-

can register constructors

-

tests if a constructor is in the registry

-

deserializes the objects for a constructor

-

throws an error if the object can't be deserialized

-

throws if the registered constructor was not a model subclass

-

should accept a hash of attributes and assign them to the new Model

-

automatically assigns an id to the model if no id is provided

-

should return the attributes of the class

-

should guard against accidental modification

-

should assign attribute values by calling through to attribute fromJSON functions

-

should not touch attributes that are missing in the json

-

should not do anything with extra JSON keys

-

should maintain empty string as empty strings

-

should parse and inflate items

-

should be fine with malformed arrays

-

should return a JSON object and call attribute toJSON functions to map values

-

should surface any exception one of the attribute toJSON functions raises

-

should run the matchers and return true iff all matchers pass

-

should pass itself as an argument to the matchers

-

should do nothing if the clipping range is infinite

-

should correctly trim the result set 5-10 to the clipping range 2-9

-

should correctly trim the result set 5-10 to the clipping range 5-10

-

should correctly trim the result set 5-10 to the clipping range 6

-

should correctly trim the result set 5-10 to the clipping range 100-200

-

should correctly trim the result set 5-10 to the clipping range 0-2

-

should trim the models cache to remove models no longer needed

-

should throw an exception if the range provided doesn't intersect (trailing)

-

should throw an exception if the range provided doesn't intersect (leading)

-

should work if the IDs array is shorter than the result range they represent (addition)

-

should work if the IDs array is shorter than the result range they represent (replacement)

-

should correctly add ids (trailing) and update the offset

-

should correctly add ids (leading) and update the offset

-

should correctly add ids (middle) and update the offset

-

should correctly add ids (middle+trailing) and update the offset

-

should throw an exception if either range is infinite

-

should return one or more ranges created by punching the provided range

-

should return true if either range is infinite

-

should return true if the ranges intersect or touch, false otherwise

-

should accept an array of Matcher objects

-

should accept a single Matcher object

-

should append to any existing where clauses

-

should accept a shorthand format

-

should return the query so it can be chained

-

should immediately raise an exception if an un-queryable attribute is specified

-

should immediately raise an exception if a non-existent attribute is specified

-

should accept an array of SortOrders

-

should accept a single SortOrder object

-

should extend any existing ordering

-

should return the query so it can be chained

-

should throw an exception if the attribute is not a joined data attribute

-

should add the provided property to the list of joined properties

-

should add all the JoinedData attributes of the class

-

should finalize the query so no further changes can be made

-

should correctly generate queries with multiple where clauses

-

should correctly escape single quotes with more double single quotes (LIKE)

-

should correctly escape single quotes with more double single quotes (equal)

-

should correctly generate COUNT queries

-

should correctly generate LIMIT 1 queries for single items

-

should correctly generate contains queries using JOINS

-

should correctly generate queries with the class's naturalSortOrder when one is available and no other orders are provided

-

should correctly generate queries requesting joined data attributes

-

should add a new subscription with the callback

-

should yield database changes to the subscription

-

should return an unsubscribe method

-

should remove the callback from the subscription

-

should wait before removing the subscription to make sure it's not reused

-

should finalize the query

-

should throw an exception if the query is a count query, which cannot be observed

-

should call update to initialize the result set

-
spec/query-subscription-spec.js -

should call _fetchRange for the entire range

-

should fetch full full models only when the previous set is empty

-

should call _fetchRange with the missingRange

-

should call _fetchRange for the entire query range when the missing range encompasses more than one range

-