Can not connect to docker instance with exposed port to 127.0.0.1

Hi,
I have a gem in ruby that needs to make HTTP requests to a rails application for testing.
I built a docker image, run it and expose the port but when my tests can not resolve the url.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9a9f4c0cb68f dummy “/bin/sh -c ‘[’/bi…” 1 second ago Up Less than a second 127.0.0.1:9873->9873/tcp reverent_pasteur
in my tests:
HTTP::ConnectionError:
failed to connect: Connection refused - connect(2) for “127.0.0.1” port 9873

I tested in local and I can access to the port.
This is the job: https://travis-ci.org/arturictus/wrappi/jobs/483778736
docker file: https://github.com/arturictus/wrappi/blob/readme/spec/dummy/Dockerfile
travis.yml: https://github.com/arturictus/wrappi/blob/readme/.travis.yml

Thanks