Been searching online for an answer to this without success - also been digging through the documentation but I''m still very new to rails. I started a brand new app (rails 2.3.2), then the first thing I did was install restful_authentication with the --rspec and -- include_activation options, then went through and followed the directions for post install as detailed in the plugin documentation. Performed a migration, then ran the rspec tests generated by the plugin. The tests failed with 6 errors, which I wasn''t expecting because I haven''t personally written a line of code yet, just used the rails and restful_authentication generated code. Has anyone else run into this? Thanks in advance~
Maurício Linhares
2009-Jun-07 17:00 UTC
Re: why do restful_authentication generated rspec tests fail?
They break ''cos they rely in a old Rspec behaviour for matching routes. The best you can do is just remove all restful_auth specs and cucumber scenarios (they''re HORRIBLE, btw, you probably won''t understand anything anyway and any change is going to be a PITA) and just write your own specs and Cucumber scenarios. Way more simpler than fixing and keeping all those specs in your project. But, if you''re in to "fix'' those specs, the problem is that routes that are not expected to be used as GET requests should be matched with this: { :path => ''/users'', :method => :post} Instead of just "/users". - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://codeshooter.wordpress.com/ (en) On Sun, Jun 7, 2009 at 1:51 PM, Jonathan<wyscript-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Been searching online for an answer to this without success - also > been digging through the documentation but I''m still very new to > rails. > > I started a brand new app (rails 2.3.2), then the first thing I did > was install restful_authentication with the --rspec and -- > include_activation options, then went through and followed the > directions for post install as detailed in the plugin documentation. > Performed a migration, then ran the rspec tests generated by the > plugin. The tests failed with 6 errors, which I wasn''t expecting > because I haven''t personally written a line of code yet, just used the > rails and restful_authentication generated code. Has anyone else run > into this? > > Thanks in advance~ > > >
Jonathan
2009-Jun-07 17:18 UTC
Re: why do restful_authentication generated rspec tests fail?
Many thanks for the explanation. Just what I needed to know. On Jun 8, 2:00 am, Maurício Linhares <mauricio.linha...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> They break ''cos they rely in a old Rspec behaviour for matching routes. > > The best you can do is just remove all restful_auth specs and cucumber > scenarios (they''re HORRIBLE, btw, you probably won''t understand > anything anyway and any change is going to be a PITA) and just write > your own specs and Cucumber scenarios. Way more simpler than fixing > and keeping all those specs in your project. > > But, if you''re in to "fix'' those specs, the problem is that routes > that are not expected to be used as GET requests should be matched > with this: > > { :path => ''/users'', :method => :post} > > Instead of just "/users". > > - > Maurício Linhareshttp://alinhavado.wordpress.com/(pt-br) |http://codeshooter.wordpress.com/(en) > > > > On Sun, Jun 7, 2009 at 1:51 PM, Jonathan<wyscr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Been searching online for an answer to this without success - also > > been digging through the documentation but I''m still very new to > > rails. > > > I started a brand new app (rails 2.3.2), then the first thing I did > > was install restful_authentication with the --rspec and -- > > include_activation options, then went through and followed the > > directions for post install as detailed in the plugin documentation. > > Performed a migration, then ran the rspec tests generated by the > > plugin. The tests failed with 6 errors, which I wasn''t expecting > > because I haven''t personally written a line of code yet, just used the > > rails and restful_authentication generated code. Has anyone else run > > into this? > > > Thanks in advance~
Robert Walker
2009-Jun-08 16:24 UTC
Re: why do restful_authentication generated rspec tests fail
Jonathan wrote:> Many thanks for the explanation. Just what I needed to know. > > > On Jun 8, 2:00�am, Maur�cio Linhares <mauricio.linha...@gmail.com>There are several forks of restful_authentication that have fixed the rSpec failures, including mine at: http://github.com/robertwalker/restful-authentication/tree/master There is nothing different in my fork except the fixes for the specs. -- Posted via http://www.ruby-forum.com/.
I''ll look into your suggestion - thanks mate. -- Posted via http://www.ruby-forum.com/.