I''ve been following along with the examples in The RSpec Book (beta 10,
Pragmatic Programmers), and I get a failure in the controller tests when
I run them in TextMate, but not from the command line. I have the
following code:
app/controllers/messages_controller.rb:
class MessagesController < ApplicationController
def create
Message.new params[:message]
end
end
spec/controllers/messages_controller_spec.rb:
require File.expand_path(File.dirname(__FILE__) +
''/../spec_helper'')
describe MessagesController, "POST create" do
it "should build a new message" do
Message.should_receive(:new).with("body" => "a quick brown
fox")
post :create, :message => { "body" => "a quick brown
fox" }
end
it "should save the message"
end
If I run either rake spec or script/spec
spec/controllers/messages_controller_spec.rb, I get 0 failures and 1
pending. In TextMate (after pulling the latest changes from
git://github.com/dchelimsky/rspec-tmbundle.git), I get:
MessagesController POST create
should build a new message
No action responded to create. Actions: add_helper, add_helper_for,
flash, forget_variables_added_to_assigns, register_verify_after_each,
render_proxy, template, unregister_verify_after_each, verify_rendered,
and verify_rendered_proc
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:617
:in `call_filters''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:610
:in `perform_action_without_benchmark''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68
:in `perform_action_without_rescue''
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17
:in `ms''
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/benchmark.rb:17
:in `ms''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/benchmarking.rb:68
:in `perform_action_without_rescue''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/rescue.rb:160
:in `perform_action_without_flash''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/flash.rb:141
:in `perform_action''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523
:in `send''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/base.rb:523
:in `process_without_filters''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/filters.rb:606
:in `sass_old_process''
/Library/Ruby/Gems/1.8/gems/haml-2.2.5/lib/sass/plugin/rails.rb:19 :in
`process''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/test_process.rb:559
:in `process_with_test''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/test_process.rb:439
:in `process''
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.2/lib/action_controller/test_process.rb:395
:in `post''
/Volumes/Users/joelyou/rspec/views_example/spec/controllers/messages_controller_spec.rb:7
/tmp/textmate-command-45977.rb:3
Ideas?
--
Posted via http://www.ruby-forum.com/.