Do this...
after do
eval IO.read(RAILS_ROOT + "/config/routes.rb")
end
Zach
On Thu, Apr 24, 2008 at 2:20 AM, Andy Croll <[EMAIL PROTECTED]> wrote:
> This bit however, replaces your other routes, so you cannot use them in
> your tests
>
> > before(:each) do
> > ActionController::Ro
This bit however, replaces your other routes, so you cannot use them in
your tests
> before(:each) do
> ActionController::Routing::Routes.draw do |map|
> map.resources :foo
> end
> end
Is there a sensible way to append to the routes.rb that I'm missing?
Andy
--
Posted via htt
Pat Maddox wrote:
> You can still use the technique that I showed, you would just call
> before_filter in the fake controller. That would allow you to specify
> and implement the filter in isolation.
Aha! Success, although I needed to add in a little Route fixing to make
it work.
application_s
On Tue, Apr 22, 2008 at 11:19 PM, Andy Croll <[EMAIL PROTECTED]> wrote:
> Pat Maddox wrote:
> > You can define a controller method on the fly in order to test this
> > out. I just did a quick experiment to demonstrate it...obviously
> > modify to suit your needs.
>
> Thanks Pat.
>
> I think I
Pat Maddox wrote:
> You can define a controller method on the fly in order to test this
> out. I just did a quick experiment to demonstrate it...obviously
> modify to suit your needs.
Thanks Pat.
I think I'm confusing two issues.
1) How to test before filters for something like authentication
2
On Mon, Apr 21, 2008 at 8:27 AM, Andy Croll <[EMAIL PROTECTED]> wrote:
> How would I go about writing specs for methods in the Application
> Controller:
>
> I'm thinking of simple methods that do authentication, through before
> filters or for example how might I spec this method in an
> applic
How would I go about writing specs for methods in the Application
Controller:
I'm thinking of simple methods that do authentication, through before
filters or for example how might I spec this method in an
application_spec.rb?
def store_location
session[:return_to] = request.request_uri
e