Follow Along as I Stumble on the Path to Learning RoR

Testing with Subdomain_Fu

I’m using Subdomain_Fu and was having issues because I didn’t know how to specify the current_subdomain.

Then I found this post on StackOverflow (Groxx): http://stackoverflow.com/questions/1143129/getting-cucumber-subdomain-fu-to-play-nice-together

I added this to the top of my RSpec specs:

def in_subdomain(str)
@request.host = “#{str}.test.host”
end

then I set my subdomains in each test with the in_subdomain method:

it “should find index” do
in_subdomain(whatever your subdomain is)
get :index
end

 

Advertisements

Comments are closed.