Add rake test, flush and tests

Flush task