Fixed tests

Fixed tests by removing full uri in the ajax query since capybara uses a random
port when running the tests.
Also changed body in text to simplify comparisons as it was failing when
comparing the text.