Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- context "creating a new tweet" do
- setup do
- login_as :sonnyjitsu
- post :create, :tweet => {:tweet => "This is my tweet"}
- end
- current_user = mock('user')
- should_change("the number of tweets", :from => 0, :to => 1) { Tweet.count }
- should_redirect_to("the tweet page") {tweet_path(Tweet.last)}
- end
- The error is this:
- sonnyjitsu@ubuntuboy:~/Development/barter140$ rake
- (in /home/sonnyjitsu/Development/barter140)
- /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/helpers/tweets_helper_test.rb" "test/unit/tweet_test.rb"
- Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
- Started
- Finished in 0.000353 seconds.
- 0 tests, 0 assertions, 0 failures, 0 errors
- /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/tweets_controller_test.rb"
- /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:398:in `send': undefined method `mock' for TweetsControllerTest:Class (NoMethodError)
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:398:in `method_missing'
- from ./test/functional/tweets_controller_test.rb:43:in `__bind_1258776323_452708'
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:293:in `call'
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:293:in `merge_block'
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:288:in `initialize'
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:169:in `new'
- from /usr/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:169:in `context'
- from ./test/functional/tweets_controller_test.rb:37
- from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
- from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
- from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
- from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
- /usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"
- Errors running test:functionals!
- mocha (0.9.8)
- thoughtbot-shoulda (2.10.2)
- rails 2.3.4
- ===SOLUTION===
- Should run any non-shoulda code (such as mocks and stubs) in the setup block
Add Comment
Please, Sign In to add comment