[rspec-users] webrat methods are undefined

Zach Dennis zach.dennis at gmail.com
Wed Jan 28 14:49:05 EST 2009

On Wed, Jan 28, 2009 at 2:29 PM, Tom Hoen <lists at ruby-forum.com> wrote:
> Josh -
> I used "git clone git://github.com/brynary/webrat.git". Should I have
> used a different repo?
> First, I set up the host with my subdomain
>  host! "rpems.test"
> Then the steps for the admin login:
>  visit "/login"
>  fill_in("login", :with => "admin")
>  fill_in("password", :with => "test")
>  click_button("Log in")

Try kicking things off with:
   visit login_url(:host =>" rpems.test")

host! is a Rails method, and outside-of the knowledge of Webrat.
Webrat only knows about the URLs and paths that you actually have it
go through. I think this may produce the results you want because
Webrat will be aware from the get-go that you're on as subdomain.

This will probably still break in webrat HEAD, I am using this branch
right now which includes a fix that is not in HEAD (it's waiting to be
merged, or for another solution to take effect):

This ensures that webrat respects subdomains while navigating through
the app. You may want to check it out until one (or al) of the
following tickets are closed:


With the aforementioned branch we haven't hit any new issues using
subdomains in our app's feature suite.

> Then i check what is returned, looking for the word "Classroom" to
> indicate that the user is on the Classrooms page.
> So the steps should go
> http://rpems.test/
> http://rpems.test/login
> Then the Log In submit, which, if the login is successful (which it
> appears to be), redirects to
> http://rpems.test/classrooms
> What else could I give you to help track down the issue (if I have
> indeed installed the correct repo).
> Thanks
> Tom
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

Zach Dennis

More information about the rspec-users mailing list