Hello,

I face the following problem for a POST create action spec.

I have this controller: http://pastie.org/482270

I wrote this spec: http://pastie.org/482273

The spec "should set @context" works fine.

But when running the spec "should build a new message" I got this error:

<Page(id: integer, title: string, content: text, created_at: datetime,
updated_at: datetime) (class)> expected :new with ({"title"=>"Introduction",
"content"=>"page d'introduction"}) once, but received it 0 time

I can not find why Page model does not receive new call, and playing around
I can have the spec running successfully when I remove :create from the
before_filter line!
#before_filter :get_context_from_session, :only => [:new, :create, :index]
before_filter :get_context_from_session, :only => [:new, :index]

It does not make sense for me. I probably miss something but I can not find
what.

Any ideas? Thanks by advance :)

Regards,
Florent
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to