     ObservableArray @, 'test'
     spyOn @test, 'push'
 
-    Model.create {}, @test
+    Post.create {}, @test
 
     request = jasmine.Ajax.requests.mostRecent()
     request.respondWith Responses.general

    ObservableArray @, 'test'
    spyOn @test, 'push'

    Model.get {}, @test

    request = jasmine.Ajax.requests.mostRecent()
    request.respondWith Responses.generalMulti

Responses =
  general:
    status: 200
    responseText: '{"id": 1, "author_id": 1}'
  generalMulti:
    status: 200
    responseText: '[{"id": 1}]'

co = new RESTConnector('/')

Post = Modelize
  api: 'posts'
  connector: co
  has_one:
    author:
      model: 'Author'
  has_many:
    comment:
      model: 'Comment'
  editable: [ 'fieldOne', 'fieldTwo' ]

# Single Submodel
Author = Modelize
  api: 'authors'
  connector: co

# Multi Submodel
Comment = Modelize
  api: 'comments'
  connector: co
  belongs_to:
    posts:
      model: 'Post'

describe 'Public Model API', ->
  beforeAll ->
    jasmine.Ajax.install()

    @instance = new Post()

  it 'is a function', ->
    expect(typeof Post).toBe 'function'

  it 'gets and calls a function', ->
    Post.get {}, (data) ->
      expect(typeof data).toBe 'object'
      expect(data.id).toBe 1

    request = jasmine.Ajax.requests.mostRecent()

    expect(request.url).toBe '/posts'
    expect(request.method).toBe 'GET'
    expect(request.data()).toEqual {}

