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

    expect(@test.push).toHaveBeenCalledWith jasmine.objectContaining({ id: 1 })

  it 'creates and calls a function', ->
    Model.create {}, (data) ->
      expect(typeof data).toBe 'object'
      expect(data.id).toBe 1

    request = jasmine.Ajax.requests.mostRecent()

    expect(request.url).toBe '/tests'
    expect(request.method).toBe 'POST'
    expect(request.data()).toEqual {}



    describe 'Relation functions', ->
      it 'has external keys', ->
        expect(@instance.author_id()).toBe 1

      it 'gets has_one relations', ->
        @instance.author_get {}, (data) ->
          expect(data).toEqual jasmine.objectContaining({ id: 1 })

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

      it 'gets has_many relations', ->
        spyOn @instance, 'comments'

        @instance.comment_get {}

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

        expect(@instance.comments).toHaveBeenCalled()
        #expect(@instance.comments).toHaveBeenCalledWith jasmine.objectContaining({ id: 1 })

      it 'creates has_many relations', ->
        spyOn @instance.comments, 'push'

        @instance.comment_add {}

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

        expect(@instance.comments.push).toHaveBeenCalled()
        #expect(@instance.comments.push).toHaveBeenCalledWith jasmine.objectContaining({ id: 1 })

      it 'exports external keys', ->
        data = @instance.export()

        expect(data).toEqual jasmine.objectContaining({ author_id: 1 })
