Skip to content

Instantly share code, notes, and snippets.

@zuchmanski
Created June 4, 2010 09:51
Show Gist options
  • Save zuchmanski/425237 to your computer and use it in GitHub Desktop.
Save zuchmanski/425237 to your computer and use it in GitHub Desktop.
Mam prosty middleware, który usuwa subdomenę "www" z requestów (zwykłe przekierowanie) - http://gist.github.com/425207
W przeglądarce wszystko działa wzorowo, problemy są z testami.
[code=ruby]host! "example.com"
root_url #=> "http://example.com/"[/code]
Przykładowy scenariusz:
- wejdź na new_post_url (przechodzi na "http://example.com/posts/new")
- ...
- kliknij "Create" (wysyła żądanie POST na "http://www.example.com/posts/"; jako, że jest www, rack przekierowuje na "example.com/posts" tylko, że zwykłym GETem).
Jak zmusić cucumbera by korzystał wszędzie, konsekwentnie z "example.com"?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment