tag:blogger.com,1999:blog-1667800305439071557.post6482034772016309116..comments2012-03-01T08:36:39.539-05:00Comments on The RoR n00b Experience: Cucumber and Subdomains Revisited (the Capybara chronicles)Chris Boothhttp://www.blogger.com/profile/11983830157745055572noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-1667800305439071557.post-26462121917743825302012-03-01T08:36:39.539-05:002012-03-01T08:36:39.539-05:00Here's what I came up with:
https://gist.gith...Here's what I came up with:<br /><br />https://gist.github.com/1939812sj26https://www.blogger.com/profile/08717146985233445171noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-52276496732001642412011-02-27T14:13:11.331-05:002011-02-27T14:13:11.331-05:00Hi,
I just start working with capybara.I am unabl...Hi,<br /><br />I just start working with capybara.I am unable to find any command in capybara for get the total number of characters in text field save.<br /><br />Suggest something<br /><br />ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-42162765889252978492010-09-05T12:47:24.235-04:002010-09-05T12:47:24.235-04:00So in Capybara master the port is now dynamically ...So in Capybara master the port is now dynamically selected using TCP. I wonder if you've found a way to test subdomains given you can't hardcode the port anymore?naderhttps://www.blogger.com/profile/00796177405127890126noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-46822929202314278982010-08-19T06:12:17.405-04:002010-08-19T06:12:17.405-04:00After quite some time trying to get this working a...After quite some time trying to get this working alopne I finally found your post which has been a great help. <br /><br />Being new to cucumber I thought it may have been me, especially as the first feature I'm testing is signup, which as Steve V mentions needs to handle redirect to a different subdomain. With your gist and the lvh.me trick the test is finally passing. <br /><br />I total agree with you about not changing the code to suit the test, I didn't feel too comfortable with that solution either.<br /><br />Thanks again for the post!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-30403444678495226772010-08-18T16:28:35.485-04:002010-08-18T16:28:35.485-04:00Oh I've done that! :)Oh I've done that! :)Chris Boothhttps://www.blogger.com/profile/12306378669011737083noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-10979792192665306302010-08-18T16:09:07.949-04:002010-08-18T16:09:07.949-04:00@Chris ignore me...I forgot to add the subdomains ...@Chris ignore me...I forgot to add the subdomains into my hosts file. Doh!John Pollinghttp://theled.co.uknoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-65053282149101854402010-08-18T15:55:33.529-04:002010-08-18T15:55:33.529-04:00@Chris ok. When I change the domain the tests fai...@Chris ok. When I change the domain the tests fail. Also, I've just tried using culerity and the tests fail with NativeException: java.net.UnknownHostException: admin.example.com.<br /><br />Just wondering if you have any suggestions?John Pollinghttp://theled.co.uknoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-3168685187067754132010-08-16T17:17:27.533-04:002010-08-16T17:17:27.533-04:00@JohnPolling Nope, that's just the default th...@JohnPolling Nope, that's just the default that Cucumber uses, and I didn't have a particular reason to change it.Chris Boothhttps://www.blogger.com/profile/12306378669011737083noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-76224008570955331372010-08-16T15:49:18.014-04:002010-08-16T15:49:18.014-04:00Thanks for this. Saved me a load of time :)
Is t...Thanks for this. Saved me a load of time :)<br /><br />Is there any particular reason you <b>must</b> use example.com as the domain?John Pollinghttp://theled.co.uknoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-55219700460031758362010-07-30T05:01:09.582-04:002010-07-30T05:01:09.582-04:00Thanks guys, both James and Chris, this helped me ...Thanks guys, both James and Chris, this helped me a lot setting up a test environment with capybara where I run everything on user based subdomains!<br /><br />I am using the lvh.me solution suggested by Ryan Bates in Railscasts 221 and I just run it through a Cucumber background step like this:<br />Capybara.default_host = "#{@club.subdomain}.lvh.me"<br /> Capybara.app_host = "http://#{@club.subdomain}.lvh.me:9887" if Capybara.current_driver == :culerity<br /> <br />Works awesome!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-89125402575544827872010-07-04T01:41:37.588-04:002010-07-04T01:41:37.588-04:00I just switched from Webrat to Capybara, and am us...I just switched from Webrat to Capybara, and am using the replacement for host! in your gist, but have a small problem. It seems to work great for one subdomain per scenario, but if there's more than one it will only navigate to the first one. I have a scenario that starts at one subdomain, makes sure some stuff is okay, and then navigates to another subdomain. I have verified that I'm setting the default_host properly before going to the second site, but it just wants to go to the first one only. Any idea what this is, or how to get around it?<br /><br />Thanks,<br />SteveSteve Vnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-45381810017246574002010-06-04T19:59:38.440-04:002010-06-04T19:59:38.440-04:00Thanks for sharing that JamesThanks for sharing that JamesChris Boothhttps://www.blogger.com/profile/12306378669011737083noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-24615703175476667482010-06-04T16:10:31.639-04:002010-06-04T16:10:31.639-04:00I've been using a very similar solution for a ...I've been using a very similar solution for a while now that I blogged about earlier today: http://jamesalmond.posterous.com/testing-subdomains-using-capybaraAnonymoushttps://www.blogger.com/profile/00173082794738461979noreply@blogger.com