[rspec-users] [Rails] Unexpected calls to *_before_type_cast in view specs

Jon Wood jon at blankpad.net
Mon Sep 13 13:15:13 EDT 2010


Good evening,

I'm having some issues with the view specs on a project newly upgraded
from rspec-rails-1.2.x to rspec-rails-1.3.2, and also having had a
Rails upgrade from 2.3.5 to 2.3.9 done at the same time.

My view specs are now failing with messages like the one at the bottom
of this message. I've had a dig around the source, but not been able
to find anything that seems particularly useful.

Is this an issue that other people have seen, and if so, is anyone
able to suggest a solution?

Cheers,

Jon Wood

    ActionView::TemplateError in '/judging_lists/edit.html.erb should render'
    unexpected invocation: #<Mock:0x1062a4200>.comments_before_type_cast()
    satisfied expectations:
    - allowed any number of times, already invoked 11 times:
Time.now(any_parameters)
    - allowed any number of times, not yet invoked: Time.now(any_parameters)
    - allowed any number of times, not yet invoked: Time.now(any_parameters)
    [... etc ...]


    On line #185 of app/views/judging_lists/edit.html.erb

        182:
        183:     <div class="question">
        184:       <h2>Judge's Comments</h2>
        185:       <%= f.text_area(:comments) %>
        186:     </div>
        187:
        188:     <div class="question">

    app/views/judging_lists/edit.html.erb:185
    app/views/judging_lists/edit.html.erb:137
    /Users/jon/.rvm/gems/ruby-1.8.7-p302 at project_name/gems/rspec-rails-1.3.2/lib/spec/rails/extensions/action_view/base.rb:27:in
`render'
    /Users/jon/.rvm/gems/ruby-1.8.7-p302 at project_name/gems/rspec-rails-1.3.2/lib/spec/rails/example/view_example_group.rb:170:in
`__send__'
    /Users/jon/.rvm/gems/ruby-1.8.7-p302 at project_name/gems/rspec-rails-1.3.2/lib/spec/rails/example/view_example_group.rb:170:in
`render'
    /spec/views/judging_lists/edit.html.erb_spec.rb:19:in `do_render'
    /spec/views/judging_lists/edit.html.erb_spec.rb:25
    rspec (1.3.0) lib/spec/example/example_methods.rb:40:in `instance_eval'
    rspec (1.3.0) lib/spec/example/example_methods.rb:40:in `execute'
    /Users/jon/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/timeout.rb:53:in
`timeout'
    rspec (1.3.0) lib/spec/example/example_methods.rb:37:in `execute'
    rspec (1.3.0) lib/spec/example/example_group_methods.rb:214:in
`run_examples'
    rspec (1.3.0) lib/spec/example/example_group_methods.rb:212:in `each'
    rspec (1.3.0) lib/spec/example/example_group_methods.rb:212:in
`run_examples'
    rspec (1.3.0) lib/spec/example/example_group_methods.rb:103:in `run'
    rspec (1.3.0) lib/spec/runner/example_group_runner.rb:23:in `run'
    rspec (1.3.0) lib/spec/runner/example_group_runner.rb:22:in `each'
    rspec (1.3.0) lib/spec/runner/example_group_runner.rb:22:in `run'
    rspec (1.3.0) lib/spec/runner/options.rb:152:in `run_examples'
    rspec (1.3.0) lib/spec/runner/command_line.rb:9:in `run'
    rspec (1.3.0) bin/spec:5


More information about the rspec-users mailing list