[rspec-users] MockExpectationError with restful-authentication

David Chelimsky dchelimsky at gmail.com
Fri Jan 2 05:00:52 EST 2009


On Thu, Jan 1, 2009 at 1:40 PM, Mark A. Richman <mark at markrichman.com> wrote:
> Thanks that helped! Now I'm getting these errors...any ideas? Looks like
> something cookie related?
>
> http://pastie.org/350148

Only the first 2 look cookie related to me. The rest seem like typos -
either things that you changed after generating the restful auth
material (like redirecting to "/dashboard" instead of "/") or perhaps
there are typos in the generated specs ("session" vs "sessions").

In most of these cases, you should be able to see from the failure
messages what the discrepancies are and you just need to choose
whether the specs are correct or the code is correct and adjust
appropriately.

HTH,
David

>
> On Wed, Dec 31, 2008 at 2:43 PM, Pat Maddox <pergesu at gmail.com> wrote:
>>
>> You didn't tell your mock object about the enabled? method. You need
>> to stub it out (prob set it to true)
>>
>> Pat
>>
>>
>> On 12/31/08, Mark A. Richman <mark at markrichman.com> wrote:
>> > Hi there...this is my first time using rspec and rspec-rails. When I run
>> > `rake spec`, I get this type of error over and over...what does it mean,
>> > and
>> > how can I correct it?
>> >
>> > Thanks,
>> > Mark
>> >
>> > 9)
>> > Spec::Mocks::MockExpectationError in 'SessionController on successful
>> > login,
>> > my request cookie token is valid, and ask not to be remembered sets an
>> > auth
>> > cookie'
>> > Mock 'User_1' received unexpected message :enabled? with (no args)
>> >
>> > /Users/mark/rails_apps/ExamRoom/app/controllers/session_controller.rb:14:in
>> > `create'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in
>> > `send'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in
>> > `perform_action_without_filters'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in
>> > `call_filters'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in
>> > `perform_action_without_benchmark'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
>> > `perform_action_without_rescue'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in
>> > `perform_action_without_rescue'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in
>> > `perform_action_without_caching'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in
>> > `perform_action'
>> >
>> > /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
>> > `cache'
>> >
>> > /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
>> > `cache'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in
>> > `perform_action'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
>> > `send'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
>> > `process_without_filters'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
>> > `process_without_session_management_support'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in
>> > `process_without_test'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:18:in
>> > `process'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:407:in
>> > `process'
>> >
>> > /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/test_process.rb:376:in
>> > `post'
>> > ./spec/controllers/session_controller_spec.rb:15:in `do_create'
>> > ./spec/controllers/session_controller_spec.rb:55:
>> >
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list