tag:blogger.com,1999:blog-1667800305439071557.comments2012-03-01T08:36:39.539-05:00The RoR n00b ExperienceChris Boothhttp://www.blogger.com/profile/11983830157745055572noreply@blogger.comBlogger19125tag: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.comtag:blogger.com,1999:blog-1667800305439071557.post-6961534231088624772010-05-25T15:58:58.109-04:002010-05-25T15:58:58.109-04:00Thanks Ramon. You're absolutely right. I jus...Thanks Ramon. You're absolutely right. I just discovered this myself as I tried to move from Webrat to Capybara and all my tests started failing for my subdomain app. Still working on the solution for that one...Chris Boothhttps://www.blogger.com/profile/12306378669011737083noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-74336782367074724962010-05-08T00:46:54.841-04:002010-05-08T00:46:54.841-04:00Just to clarify to others: this doesn't work w...Just to clarify to others: this doesn't work with Capybara. It seems that maintaining of the host is the job of Capybara or Webrat, whichever you decide to use.Ramonhttps://www.blogger.com/profile/16360440870111079337noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-84099310658528168382009-09-07T14:41:09.590-04:002009-09-07T14:41:09.590-04:00Hello,
Thanks. But, I am getting an application in...Hello,<br />Thanks. But, I am getting an application initialization failure error for indexer for rake ts:index.<br /><br />Any idea?<br /><br />love-n-peace,<br />@shaanAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-15496107433680231092009-07-08T12:40:37.443-04:002009-07-08T12:40:37.443-04:00You can add code by surrounding it in <pre> ...You can add code by surrounding it in <pre> </pre> tags. Then it will appear as it looks. It won't be color coded like some sites tho.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-54774216783231365572009-06-05T14:29:56.299-04:002009-06-05T14:29:56.299-04:00Sorry, I should have been a little more clear. Th...Sorry, I should have been a little more clear. The problem isn't in the line "When I visit ...". The problem comes after that when you try to follow links on a page. It doesn't seem to follow the subdomain at that point. For example:<br /><br />When I visit http://subdomain.example.com<br />And I log in as ...<br />And I follow ...<br /><br />This fails (at least for me on 0.3.1) as the subsequent requests don't follow the subdomain (at least that's what I've gathered as the root of the problem).Chris Boothhttps://www.blogger.com/profile/11983830157745055572noreply@blogger.comtag:blogger.com,1999:blog-1667800305439071557.post-48981284153929169942009-06-04T16:55:22.653-04:002009-06-04T16:55:22.653-04:00Why not just use a full url?
When I visit http://...Why not just use a full url?<br /><br />When I visit http://subdomain.example.com/foo<br /><br />for example....<br /><br />dstarAnonymousnoreply@blogger.com