Skip to content

Instantly share code, notes, and snippets.

@lardawge
Created November 8, 2010 17:23
Show Gist options
  • Save lardawge/667961 to your computer and use it in GitHub Desktop.
Save lardawge/667961 to your computer and use it in GitHub Desktop.
Failing spec
Failures:
1) UsersController#index returns a paginated collection
Failure/Error: assigns[:users].should be_an_instance_of(WillPaginate::Collection)
expected [#<User id: 1, name: "name-1", created_at: "2010-11-08 17:20:42", updated_at: "2010-11-08 17:20:42">, #<User id: 2, name: "name-2", created_at: "2010-11-08 17:20:42", updated_at: "2010-11-08 17:20:42">, #<User id: 3, name: "name-3", created_at: "2010-11-08 17:20:42", updated_at: "2010-11-08 17:20:42">, #<User id: 4, name: "name-4", created_at: "2010-11-08 17:20:42", updated_at: "2010-11-08 17:20:42">, #<User id: 5, name: "name-5", created_at: "2010-11-08 17:20:42", updated_at: "2010-11-08 17:20:42">] to be an instance of WillPaginate::Collection
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-expectations-2.1.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-expectations-2.1.0/lib/rspec/expectations/handler.rb:21:in `handle_matcher'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-expectations-2.1.0/lib/rspec/expectations/extensions/kernel.rb:27:in `should'
# ./spec/controllers/users_controller_spec.rb:14:in `block (3 levels) in <top (required)>'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:42:in `instance_eval'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:42:in `block (2 levels) in run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:81:in `call'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:81:in `with_around_hooks'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:39:in `block in run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:75:in `call'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:75:in `block in with_pending_capture'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:74:in `catch'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:74:in `with_pending_capture'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example.rb:38:in `run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:261:in `block in run_examples'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:257:in `map'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:257:in `run_examples'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:231:in `run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:232:in `block in run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:232:in `map'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:232:in `run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `block (2 levels) in run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `map'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `block in run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/reporter.rb:12:in `report'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:24:in `run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:55:in `run_in_process'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:46:in `run'
# /Users/lar/.rvm/gems/ruby-1.9.2-p0@rspec_bug/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:10:in `block in autorun'
Finished in 0.11715 seconds
1 example, 1 failure
class UsersController < ApplicationController
def index
@users = User.paginate(:page => 1)
end
end
require 'spec_helper'
describe UsersController do
context '#index' do
before(:each) do
5.times do
Factory :user
end
end
it 'returns a paginated collection' do
get :index
assigns[:users].should be_an_instance_of(WillPaginate::Collection)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment