Properly handle actions that return deferreds and add test for successful action dispatching.