 
             send_data = network.send_data
             expect( send_data.getCall( send_data.callCount - 2 ).args[0].length ).to.equal new_mtu - 3
+
+        it 'sends more data when progress indicates all data received at once', ->
+            # Simulate that the bootloader sends a progress message, right after the first page
+            [ data_send, cons ] = collect_buffer_send( network, 0, receive_capacity )
+
+            checksum  = crc.buf data_send, checksum
+
+            progress_callback = network.register_progress_callback.lastCall.args[ 0 ]
+            progress_callback( checksum, cons, mtu, receive_capacity )
+
+            expect( error_callback.called ).to.be.false
+            expect( collect_data_send( network ).length ).to.be.least 2 * receive_capacity


            it 'should send the first data', ->
                expect( collect_data_send( network ) ).to.deep.equal( data.slice( 0, receive_capacity ) )

        describe 'writeing just a part of a page', ->



        describe 'start address not beeign equal to a page address', ->

            checksum    = null

            beforeEach ->
                start_address   = 3 * page_size + 0x123
                checksum        = crc.buf [ 0x23, 0x0D, 0x00, 0x00 ]
                receive_capacity= page_size * ( page_buffers - 1 ) + ( page_size - 0x123 )

                new flash.FlashMemory network, start_address, data, address_size, page_size, page_buffers, error_callback
                network.start_flash.lastCall.args[ 1 ]( null, mtu, receive_capacity, checksum )
