jasmine test for decode and encode