Re: [rspec-users] Help in Stubing is_admin? method

2009-10-19 Thread Ashley Moran
On 19 Oct 2009, at 21:55, Elza wrote: def edit @user = User.find(get_param(:id, :integer)) @user = current_user if !is_admin? end Hi Elza Am I right thinking your intent here is the same as: def edit @user = if is_admin? User.find(get_param(:id, :integer)) else

[rspec-users] Help with controllers specs

2009-10-19 Thread Elza Di Sirio
I had some doubts while specing the action edit for User Model My controller def edit @user = User.find(get_param(:id, :integer)) @user = current_user if !is_admin? end *** My spec describe "GET edit" do ###

[rspec-users] Help in Stubing is_admin? method

2009-10-19 Thread Elza
My controller def edit @user = User.find(get_param(:id, :integer)) @user = current_user if !is_admin? end * My spec describe "GET edit" do ## should_require_login :get, :edit #

Re: [rspec-users] Is it possible to access Example scope from Formatter?

2009-10-19 Thread Jarmo Pertman
Thank you for the reply! I have to admit that for a second I thought about using 'options' somehow, but wasn't sure if it would work or not so i forgot the possibility to use it at all and tried different approaches. Anyway, it seems that your exact code snippet doesn't work so I made one formatt

[rspec-users] Rake task lists

2009-10-19 Thread Bryan Kearney
Is this a known difference for windows systems? When I run rake --tasks I see one task for each spec in the file list? If I run the same on win32, all I get is the 'all' task. I scanned lists, and I did not see anything about this. -- bk ___ rspec-us

Re: [rspec-users] How to write a correct RSpec for Polymorphic Association

2009-10-19 Thread David Chelimsky
On Mon, Oct 19, 2009 at 10:48 AM, Sergey Rogachev wrote: > *unexpected message > Please copy the exact error instead of re-typing it. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to write a correct RSpec for Polymorphic Association

2009-10-19 Thread Sergey Rogachev
*unexpected message -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] How to write a correct RSpec for Polymorphic Association

2009-10-19 Thread Sergey Rogachev
David Chelimsky wrote: > On Fri, Oct 16, 2009 at 7:21 AM, Sergey Rogachev > wrote: > David Hi David, It doesn't work, I got the following message: Mock 'addresses' recieved unexcepted message :new with ({:these => 'params'}) Regards, Sergey -- Posted via http://www.ruby-forum.com/. ___