kareem
kareem

Reputation: 690

Did test server port change in Rails 2.3?

I upgraded rails to 2.3.2 from 2.1.1 yesterday and a bunch of my tests started failing.

When I was running under 2.1.1, the test server was running on port 3000 so I had a HOST_DOMAIN variable that included the port - HOST_DOMAIN = "localhost.tst:3000". This is so my assert_redirected_to's would succeed.

Now, however, it seems that the test server is running on port 80, so the port in HOST_DOMAIN is causing tests to fail.

There's no specific reason I'm keeping the port in HOST_DOMAIN. I more want to know whether something in Rails 2.3 changed the port the test server runs on and where I can read more about why. I've searched a ton and can't find anything, so I'm going to my go-to place to ask development questions :)

Thanks in advance.

Upvotes: 1

Views: 1219

Answers (3)

Koterpillar
Koterpillar

Reputation: 8104

Test request use "test.host", which would be port 80. You can write

@request.host = 'www.example.com'
@request.port = 3000

http://lists.rubyonrails.org/pipermail/rails/2006-April/030204.html

Upvotes: 1

rubyruy
rubyruy

Reputation: 7922

Which test server are you referring to exactly?

Are you talking about the "simulated" server that runs in integration and "functional" tests?

I assume you're using rails' built-in test::unit stuff?

Upvotes: 0

nitecoder
nitecoder

Reputation: 5486

Default is still Port 3000, something with your config must be changing it somehow.

EDIT: I suck at reading. I thought that you meant when you ran script/server on the command line.

Upvotes: 0

Related Questions