Skip to content

Instantly share code, notes, and snippets.

@zetas
Created November 22, 2013 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zetas/7603965 to your computer and use it in GitHub Desktop.
Save zetas/7603965 to your computer and use it in GitHub Desktop.
Lol, i've gone a little crazy methinks.
bundle exec rspec
[Report a Problem]0 min 9 sec
ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
TodosController
POST create
with valid params
 (2.2ms) BEGIN
Processing by TodosController#create as HTML
Parameters: {"todo"=>{"title"=>"MyString"}}
 (0.2ms) SAVEPOINT active_record_1
SQL (55.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.9ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos/1
Completed 302 Found in 81ms (ActiveRecord: 58.6ms)
Todo Load (1.6ms) SELECT "todos".* FROM "todos" ORDER BY "todos"."id" DESC LIMIT 1
 (0.3ms) ROLLBACK
 redirects to the created todo
 (0.2ms) BEGIN
Processing by TodosController#create as HTML
Parameters: {"todo"=>{"title"=>"MyString"}}
 (0.1ms) SAVEPOINT active_record_1
SQL (0.7ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.3ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos/2
Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
 (0.2ms) ROLLBACK
 assigns a newly created todo as @todo
 (0.2ms) BEGIN
 (0.5ms) SELECT COUNT(*) FROM "todos"
Processing by TodosController#create as HTML
Parameters: {"todo"=>{"title"=>"MyString"}}
 (0.2ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.4ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos/3
Completed 302 Found in 5ms (ActiveRecord: 1.1ms)
 (0.9ms) SELECT COUNT(*) FROM "todos"
 (0.2ms) ROLLBACK
 creates a new Todo
with invalid params
 (0.1ms) BEGIN
 (0.1ms) ROLLBACK
 assigns a newly created but unsaved todo as @todo (FAILED - 1)
 (0.7ms) BEGIN
 (0.3ms) ROLLBACK
 re-renders the 'new' template (FAILED - 2)
GET index
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (0.6ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.8ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#index as HTML
Completed 200 OK in 51ms (Views: 50.4ms | ActiveRecord: 0.0ms)
Todo Load (0.5ms) SELECT "todos".* FROM "todos"
 (0.3ms) ROLLBACK
 assigns all todos as @todos
DELETE destroy
 (0.1ms) BEGIN
 (0.2ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.1ms) RELEASE SAVEPOINT active_record_1
 (0.2ms) SELECT COUNT(*) FROM "todos"
Processing by TodosController#destroy as HTML
Parameters: {"id"=>"5"}
Todo Load (0.7ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "5"]]
 (0.1ms) SAVEPOINT active_record_1
SQL (0.4ms) DELETE FROM "todos" WHERE "todos"."id" = $1 [["id", 5]]
 (0.1ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos
Completed 302 Found in 7ms (ActiveRecord: 1.3ms)
 (0.3ms) SELECT COUNT(*) FROM "todos"
 (0.2ms) ROLLBACK
 destroys the requested todo
 (0.1ms) BEGIN
 (0.2ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.1ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#destroy as HTML
Parameters: {"id"=>"6"}
Todo Load (0.3ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "6"]]
 (0.1ms) SAVEPOINT active_record_1
SQL (0.2ms) DELETE FROM "todos" WHERE "todos"."id" = $1 [["id", 6]]
 (0.2ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos
Completed 302 Found in 4ms (ActiveRecord: 0.9ms)
 (0.2ms) ROLLBACK
 redirects to the todos list
GET edit
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.2ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#edit as HTML
Parameters: {"id"=>"7"}
Todo Load (0.4ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "7"]]
Completed 200 OK in 3ms (Views: 1.4ms | ActiveRecord: 0.4ms)
 (0.2ms) ROLLBACK
 assigns the requested todo as @todo
GET show
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.2ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#show as HTML
Parameters: {"id"=>"8"}
Todo Load (0.5ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "8"]]
Completed 200 OK in 3ms (Views: 1.6ms | ActiveRecord: 0.5ms)
 (0.3ms) ROLLBACK
 assigns the requested todo as @todo
PUT update
with valid params
 (0.2ms) BEGIN
 (0.2ms) SAVEPOINT active_record_1
SQL (0.6ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.2ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#update as HTML
Parameters: {"todo"=>{"title"=>"MyString"}, "id"=>"9"}
Todo Load (0.4ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "9"]]
 (0.1ms) SAVEPOINT active_record_1
 (0.2ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos/9
Completed 302 Found in 6ms (ActiveRecord: 0.7ms)
 (0.1ms) ROLLBACK
 redirects to the todo
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.1ms) RELEASE SAVEPOINT active_record_1
Processing by TodosController#update as HTML
Parameters: {"todo"=>{"title"=>"MyString"}, "id"=>"10"}
Todo Load (0.3ms) SELECT "todos".* FROM "todos" WHERE "todos"."id" = $1 LIMIT 1 [["id", "10"]]
 (0.1ms) SAVEPOINT active_record_1
 (0.1ms) RELEASE SAVEPOINT active_record_1
Redirected to http://test.host/todos/10
Completed 302 Found in 6ms (ActiveRecord: 0.5ms)
 (0.3ms) ROLLBACK
 assigns the requested todo as @todo
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (2.4ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (2.3ms) RELEASE SAVEPOINT active_record_1
 (2.5ms) ROLLBACK
 updates the requested todo (FAILED - 3)
with invalid params
 (0.4ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (0.5ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (0.1ms) RELEASE SAVEPOINT active_record_1
 (0.1ms) ROLLBACK
 assigns the todo as @todo (FAILED - 4)
 (0.1ms) BEGIN
 (0.1ms) SAVEPOINT active_record_1
SQL (1.6ms) INSERT INTO "todos" ("created_at", "title", "updated_at") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00], ["title", "MyString"], ["updated_at", Fri, 22 Nov 2013 17:41:56 UTC +00:00]]
 (2.2ms) RELEASE SAVEPOINT active_record_1
 (5.6ms) ROLLBACK
 re-renders the 'edit' template (FAILED - 5)
GET new
 (0.2ms) BEGIN
Processing by TodosController#new as HTML
Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms)
 (0.8ms) ROLLBACK
 assigns a new todo as @todo
todos/edit
 (0.4ms) BEGIN
 (0.3ms) ROLLBACK
 renders the edit todo form (FAILED - 6)
Todos
GET /todos
 (0.2ms) BEGIN
Started GET "/todos" for 127.0.0.1 at 2013-11-22 17:41:57 +0000
Processing by TodosController#index as HTML
Todo Load (0.8ms) SELECT "todos".* FROM "todos"
Completed 200 OK in 526ms (Views: 505.6ms | ActiveRecord: 0.8ms)
 (0.3ms) ROLLBACK
 works! (now write some real specs)
TodosHelper
 add some examples to (or delete) /home/rof/src/bitbucket.org/zetas/project-sol/spec/helpers/todos_helper_spec.rb (PENDING: No reason given)
Todo
 (0.4ms) BEGIN
 (0.2ms) ROLLBACK
 is invalid without a title
todos/index
 (1.7ms) BEGIN
 (1.8ms) ROLLBACK
 renders a list of todos (FAILED - 7)
TodosController
routing
 (1.8ms) BEGIN
 (1.9ms) ROLLBACK
 routes to #create
 (2.5ms) BEGIN
 (0.1ms) ROLLBACK
 routes to #index
 (0.1ms) BEGIN
 (0.1ms) ROLLBACK
 routes to #destroy
 (0.1ms) BEGIN
 (0.1ms) ROLLBACK
 routes to #edit
 (0.1ms) BEGIN
 (0.1ms) ROLLBACK
 routes to #new
 (0.2ms) BEGIN
 (0.1ms) ROLLBACK
 routes to #update
 (0.1ms) BEGIN
 (0.2ms) ROLLBACK
 routes to #show
todos/show
 (0.1ms) BEGIN
 (0.1ms) ROLLBACK
 renders attributes in <p> (FAILED - 8)
todos/new
 (0.2ms) BEGIN
 (0.5ms) ROLLBACK
 renders new todo form (FAILED - 9)
Pending:
 TodosHelper add some examples to (or delete) /home/rof/src/bitbucket.org/zetas/project-sol/spec/helpers/todos_helper_spec.rb
 # No reason given
 # ./spec/helpers/todos_helper_spec.rb:14
Failures:
1) TodosController POST create with invalid params assigns a newly created but unsaved todo as @todo
Failure/Error: Todo.any_instance.stub(:save).and_return(false)
NoMethodError:
undefined method `stub' for #<Mocha::ClassMethods::AnyInstance:0x00000003f720f8>
 # ./spec/controllers/todos_controller_spec.rb:87:in `block (4 levels) in <top (required)>'
2) TodosController POST create with invalid params re-renders the 'new' template
Failure/Error: Todo.any_instance.stub(:save).and_return(false)
NoMethodError:
undefined method `stub' for #<Mocha::ClassMethods::AnyInstance:0x00000003f720f8>
 # ./spec/controllers/todos_controller_spec.rb:94:in `block (4 levels) in <top (required)>'
3) TodosController PUT update with valid params updates the requested todo
Failure/Error: Todo.any_instance.should_receive(:update).with({ "title" => "MyString" })
NoMethodError:
undefined method `should_receive' for #<Mocha::ClassMethods::AnyInstance:0x00000003f720f8>
 # ./spec/controllers/todos_controller_spec.rb:109:in `block (4 levels) in <top (required)>'
4) TodosController PUT update with invalid params assigns the todo as @todo
Failure/Error: Todo.any_instance.stub(:save).and_return(false)
NoMethodError:
undefined method `stub' for #<Mocha::ClassMethods::AnyInstance:0x00000003f720f8>
 # ./spec/controllers/todos_controller_spec.rb:130:in `block (4 levels) in <top (required)>'
5) TodosController PUT update with invalid params re-renders the 'edit' template
Failure/Error: Todo.any_instance.stub(:save).and_return(false)
NoMethodError:
undefined method `stub' for #<Mocha::ClassMethods::AnyInstance:0x00000003f720f8>
 # ./spec/controllers/todos_controller_spec.rb:138:in `block (4 levels) in <top (required)>'
6) todos/edit renders the edit todo form
Failure/Error: @todo = assign(:todo, stub_model(Todo,
NoMethodError:
undefined method `proxy_for' for nil:NilClass
 # ./spec/views/todos/edit.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'
7) todos/index renders a list of todos
Failure/Error: stub_model(Todo,
NoMethodError:
undefined method `proxy_for' for nil:NilClass
 # ./spec/views/todos/index.html.erb_spec.rb:6:in `block (2 levels) in <top (required)>'
8) todos/show renders attributes in <p>
Failure/Error: @todo = assign(:todo, stub_model(Todo,
NoMethodError:
undefined method `proxy_for' for nil:NilClass
 # ./spec/views/todos/show.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'
9) todos/new renders new todo form
Failure/Error: assign(:todo, stub_model(Todo,
NoMethodError:
undefined method `proxy_for' for nil:NilClass
 # ./spec/views/todos/new.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'
Finished in 1.17 seconds
30 examples, 9 failures, 1 pending
Failed examples:
rspec ./spec/controllers/todos_controller_spec.rb:85 # TodosController POST create with invalid params assigns a newly created but unsaved todo as @todo
rspec ./spec/controllers/todos_controller_spec.rb:92 # TodosController POST create with invalid params re-renders the 'new' template
rspec ./spec/controllers/todos_controller_spec.rb:103 # TodosController PUT update with valid params updates the requested todo
rspec ./spec/controllers/todos_controller_spec.rb:127 # TodosController PUT update with invalid params assigns the todo as @todo
rspec ./spec/controllers/todos_controller_spec.rb:135 # TodosController PUT update with invalid params re-renders the 'edit' template
rspec ./spec/views/todos/edit.html.erb_spec.rb:12 # todos/edit renders the edit todo form
rspec ./spec/views/todos/index.html.erb_spec.rb:19 # todos/index renders a list of todos
rspec ./spec/views/todos/show.html.erb_spec.rb:12 # todos/show renders attributes in <p>
rspec ./spec/views/todos/new.html.erb_spec.rb:12 # todos/new renders new todo form
Randomized with seed 61253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment