Change helper method for get json string and add rspec test