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
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
###
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
#
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
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
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
*unexpected message
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
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/.
___