I figured out how to sort this issue.
In my before block in my specs I simply added:
before(:each) do
@request.host = "#{mock_subdomain}.example.com"
end
This setups up the request.subdomains.first to be the value of the mock_subdomain.
Hope someone finds this useful as its not explained very well anywhere else on the net.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…