[rspec-users] rspec2, rails 3, subdomain constraints

Evgeniy Dolzhenko dolzenko at gmail.com
Thu Nov 25 08:03:09 EST 2010


On Wed, Nov 24, 2010 at 5:12 AM, jrbruce <jrbruce at gmail.com> wrote:
> I'm trying to constrain access to admin routes in my application to
> either www or canonical. I need the custom constraint in
> root_domain.rb (RootDomain) to handle the canonical part. Since the
> subdomains will represent accounts, I don't want /admin available on
> any of the subdomains.
> Here is a gist showing exactly how my code and tests are setup:
> https://gist.github.com/712968
> In the first test, I expect /admin not to be routable on a generic
> subdomain (this test currently doesn't pass). However, when I check in
> a browser, I receive a not routable error.
> If I remove the custom constraint and use, for example, the :subdomain
> => "www" constraint, the test does pass. I've tested both the custom
> constraint and the subdomain constraint in my browser and both
> restrict access as expected.
> Is this an issue with rspec and how it handles constraints or am I
> doing something wrong?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list