Refactored tests
Added the assertions before flushing