       title:  'Test Title'
       content: 'Test Content'
 
+    expect(@post.comments().length).toBe 1
+
   it 'exports containers', ->
     data = @post.export()
 
     expect(data).toEqual jasmine.objectContaining({ PostData: { title: 'Post Title', content: 'Post Content' } })
     expect(data).toEqual jasmine.objectContaining({ comments: [ {title: 'Test Title', content: 'Test Content'} ] })
+
+  it 'exports all containers on create', ->
+    @post.create()
+
+    request = jasmine.Ajax.requests.mostRecent()
+
+    expect(request.url).toBe '/posts'
+    expect(request.method).toBe 'POST'
+
+    datahandler = new JSONHandler()
+    postdata = datahandler.load(request.data()['postdata'])
+    comments = datahandler.load(request.data()['comments'])
+
+    expect(postdata).toEqual jasmine.objectContaining({ title: 'Post Title', content: 'Post Content' })
+    expect(comments).toEqual jasmine.objectContaining([ {title: 'Test Title', content: 'Test Content'} ])
+
+    request.respondWith Responses.general
+
+    expect(@post.id).toBe 1
+
+  it 'saves the container on edit', ->
+    @post.comments()[0].title 'New Title'
+
+    jasmine.clock().tick 1
+
+    request = jasmine.Ajax.requests.mostRecent()
+
+    expect(request.url).toBe '/posts/1'
+    expect(request.method).toBe 'POST'
+
+    datahandler = new JSONHandler()
+    comments = datahandler.load(request.data()['comments'])
+
+    expect(comments).toEqual jasmine.objectContaining([ {title: 'New Title', content: 'Test Content'} ])

describe 'Container', ->
  beforeAll ->
    PostData = Container
      editable: [
        'title',

        'title',
        'content'
      ]
      observable: [
        'editing'
      ]

    co = new RESTConnector('/')

    Post = Modelize
      api: 'posts'
      save_delay: 0
      connector: co
      container:
        PostData:
