On 5 Dec 2008, at 20:31, Daniel Lopes wrote:
Ashley Moran gave me help in another post that I open by accident
when entries in the group, and now spec passed... But I still would
like to understand more about mocks and stubs that I asked in
previous email.
Yes I just noticed I re-answere
Thanks a lot Nick...
No, i'm not using Authlogic because already have base project with
restful_authentication implemented with activation, roles and etc... and
when I look authlogic the project was young, I don't know now.
About Martin Fowler post, I already readed... but the problem is because I
Ashley Moran gave me help in another post that I open by accident when
entries in the group, and now spec passed... But I still would like to
understand more about mocks and stubs that I asked in previous email.
Thanks again and sorry many emails.
Atenciosamente,
Daniel Lopes Area Criações
D
On 2008-12-05, at 10:06, Daniel Lopes wrote:
Thanks for help and sorry for insistance but I don't understand
aspects on rspec ( I think not understand how we use mocks and stubs):
Hi Daniel. If you're a bit unsure about when to use mocks vs stubs,
have a read of this article by Martin Fowler
Thanks for help and sorry for insistance but I don't understand aspects on
rspec ( I think not understand how we use mocks and stubs):
The behavior of my controller is...
Before Filter:
check_administrator_role
load_user
So, in this case I want run my before filter methods in before block on
rspec
On Fri, Dec 5, 2008 at 8:07 AM, Daniel Lopes <[EMAIL PROTECTED]> wrote:
> Thanks Newman, I already try this but get strange error:
> before do
> @current_user = mock_model(User, :id => 1)
> controller.stub!(:check_administrator_role).and_return(true)
> User.stub(:find).with(1).and_ret
Daniel Lopes wrote:
Thanks Newman, I already try this but get strange error:
before do
@current_user = mock_model(User, :id => 1)
controller.stub!(:check_administrator_role).and_return(true)
User.stub(:find).with(1).and_return(@user) # <=<=<=<=<=<=
Looks like a missing '!':
User
Thanks Newman, I already try this but get strange error:
before do
@current_user = mock_model(User, :id => 1)
controller.stub!(:check_administrator_role).and_return(true)
User.stub(:find).with(1).and_return(@user) # <=<=<=<=<=<=
end
The error:
undefined method `stub' for #
Atenci
On Fri, Dec 5, 2008 at 7:58 AM, Newman Huang <[EMAIL PROTECTED]> wrote:
>
> try:
>
> [EMAIL PROTECTED] = User.find(params[:user_id])
> User.stub(:find).with(xx).and_return(@user)
Please quote enough of the email to which you are responding to
provide enough context so that those of us who read ema
try:
[EMAIL PROTECTED] = User.find(params[:user_id])
User.stub(:find).with(xx).and_return(@user)
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hello, I'm trying learn Rspec but having problems to understand when and how
user mocks and stubs.
I have a properties_controller with to before_filter actions
(check_administrator_role e load_user)... to access index action of
properties_controller I need have a params[:user] and this parameter wi
11 matches
Mail list logo