simple_table_for 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -2
  3. data/lib/simple_table_for/version.rb +1 -1
  4. data/lib/simple_table_for.rb +58 -35
  5. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  6. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  7. data/test/dummy/app/controllers/posts_controller.rb +6 -0
  8. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  9. data/test/dummy/app/models/post.rb +2 -0
  10. data/test/dummy/app/views/posts/defaults.html.erb +5 -0
  11. data/test/dummy/app/views/posts/render.html.erb +5 -0
  12. data/test/dummy/config/routes.rb +2 -0
  13. data/test/dummy/db/development.sqlite3 +0 -0
  14. data/test/dummy/db/migrate/20150330124236_create_posts.rb +10 -0
  15. data/test/dummy/db/schema.rb +23 -0
  16. data/test/dummy/db/test.sqlite3 +0 -0
  17. data/test/dummy/log/RAILS_ENV=test.log +0 -0
  18. data/test/dummy/log/development.log +87 -0
  19. data/test/dummy/log/test.log +500 -0
  20. data/test/dummy/test/controllers/posts_controller_test.rb +46 -0
  21. data/test/dummy/test/fixtures/posts.yml +9 -0
  22. data/test/dummy/test/models/post_test.rb +7 -0
  23. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  24. data/test/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  35. data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  36. data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  37. data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  38. data/test/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  39. data/test/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  40. data/test/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  41. data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  42. data/test/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  43. data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  44. data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  45. data/test/fixtures/posts.yml +9 -0
  46. metadata +92 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 846bfe4722e8b2f31f5dfb3e02f3bace12c1e4f2
4
- data.tar.gz: 1cb57442b1c4d4dac59fbfd848fb4ee8a2d33de8
3
+ metadata.gz: c3243bc0d3e912d28400a09a011fad988f555ea5
4
+ data.tar.gz: d25e8b7fc1ff401b019bdce74eb56ffcdf76793f
5
5
  SHA512:
6
- metadata.gz: e794c1eb7aa54eaf9301d93d720941d585bd6f7d36d2ffdb011e48a993c8d3a158ba8db42e1a0a1d6b575041523db7317e52b99633039374fc5fa291805be100
7
- data.tar.gz: e10305161cebc27c954fbf75e2c511871ad51fed1fa0a3cf1cbcf86f7dfa7b9e0942dee5de3fca9285ca1175a30a7398fe0b0ac2552b68b0e481e1efbfb6d1e6
6
+ metadata.gz: caef0640187abfadd02068b9253c2549d02ca9e92671fb3e2cb460dfd3f5a5cd26adc054b4aaa57c84d71f6f89a2c2c85fe329a83a38ce5fda3de0564718930b
7
+ data.tar.gz: c932e0cc79eb4c7859228a81c5516942f6b10882badec95f56b499f08d1414a64d86716e0d8f36a79b44429935f044e720213f916f2768f0ccd99a74c24a6e46
data/README.md CHANGED
@@ -1,8 +1,23 @@
1
- = SimpleTableFor
1
+ SimpleTableFor
2
+ ==============
2
3
 
3
- Usage:
4
+ A simple helper to generate tables in Rails applications.
5
+
6
+ In your Gemfile:
7
+
8
+ ```ruby
9
+ gem 'simple_table_for'
10
+ ```
11
+
12
+ Parameters:
4
13
 
5
14
  ```ruby
15
+ table_for(collection, headers, options, &block)
16
+ ```
17
+
18
+ Usage:
19
+
20
+ ```erb
6
21
  <%= table_for @posts, %w[Title Text Date Comments\ count -] do |post| %>
7
22
  <%= field post.title %>
8
23
  <%= field post.text %>
@@ -12,4 +27,30 @@ Usage:
12
27
  <% end %>
13
28
  ```
14
29
 
30
+ You can optionally add an id or classes to tables and fields:
31
+
32
+ ```erb
33
+ <%= table_for @posts, %w[Title -], id: 'posts-table', class: 'table' do |post| %>
34
+ <%= field post.title, class: 'post-title' %>
35
+ <%= field link_to('View', post), class: 'view' %>
36
+ <% end %>
37
+ ```
38
+
39
+ You can also set default id and class for tables:
40
+
41
+ ```ruby
42
+ # application.rb
43
+ class Application < Rails:Application
44
+ SimpleTableFor::Defaults.set id: 'table-id', class: 'table table-condensed table-striped table-bordered'
45
+ end
46
+ ```
47
+
15
48
  This project uses MIT-LICENSE.
49
+
50
+ ## Contributing
51
+
52
+ 1. Fork it ( https://github.com/andreynering/simple_table_for/fork )
53
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
54
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
55
+ 4. Push to the branch (`git push origin my-new-feature`)
56
+ 5. Create a new Pull Request
@@ -1,3 +1,3 @@
1
1
  module SimpleTableFor
2
- VERSION = '0.0.2'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -1,41 +1,64 @@
1
1
  module SimpleTableFor
2
- def field(content, options = {})
3
- <<-TD.html_safe
4
- <td id='#{options[:id]}' class='#{options[:class]}'>
5
- #{content}
6
- </td>
7
- TD
2
+ module Helpers
3
+ def field(content, options = {})
4
+ <<-TD.html_safe
5
+ <td id='#{options[:id]}' class='#{options[:class]}'>
6
+ #{content}
7
+ </td>
8
+ TD
9
+ end
10
+
11
+ # Usage:
12
+ # <%= table_for @posts, %w[Title Text Date Comments\ count -] do |post| %>
13
+ # <%= field post.title %>
14
+ # <%= field post.text %>
15
+ # <%= field post.date %>
16
+ # <%= field post.comments.count %>
17
+ # <%= field link_to('View', post) %>
18
+ # <% end %>
19
+ def table_for(collection, heads, options = {})
20
+ heads = heads.map{|h| "<th>#{h}</th>".html_safe }.join('')
21
+
22
+ rows = collection.map do |obj|
23
+ "<tr>#{capture{ yield obj }}</tr>".html_safe
24
+ end.join('')
25
+
26
+ options = Defaults.get.merge options
27
+
28
+ <<-TABLE.html_safe
29
+ <table id='#{options[:id]}' class='#{options[:class]}'>
30
+ <thead>
31
+ <tr>
32
+ #{heads}
33
+ </tr>
34
+ </thead>
35
+
36
+ <tbody>
37
+ #{rows}
38
+ </tbody>
39
+ </table>
40
+ TABLE
41
+ end
8
42
  end
9
43
 
10
- # Usage:
11
- # <%= table_for @posts, %w[Title Text Date Comments\ count -] do |post| %>
12
- # <%= field post.title %>
13
- # <%= field post.text %>
14
- # <%= field post.date %>
15
- # <%= field post.comments.count %>
16
- # <%= field link_to('View', post) %>
17
- # <% end %>
18
- def table_for(collection, heads, options = {})
19
- heads = heads.map{|h| "<th>#{h}</th>".html_safe }.join('')
20
-
21
- rows = collection.map do |obj|
22
- "<tr>#{capture{ yield obj }}</tr>".html_safe
23
- end.join('')
24
-
25
- <<-TABLE.html_safe
26
- <table id='#{options[:id]}' class='#{options[:class]}'>
27
- <thead>
28
- <tr>
29
- #{heads}
30
- </tr>
31
- </thead>
32
-
33
- <tbody>
34
- #{rows}
35
- </tbody>
36
- </table>
37
- TABLE
44
+ # This class handles the default options
45
+ class Defaults
46
+ # Get de default options
47
+ def self.get
48
+ @defaults || defaults
49
+ end
50
+
51
+ # Set the default options
52
+ # SimpleTableFor::Defaults.set id: 'id', class: 'class'
53
+ def self.set(options)
54
+ @defaults = defaults.merge options
55
+ end
56
+
57
+ private
58
+ def self.defaults
59
+ {id: '', class: ''}
60
+ end
38
61
  end
39
62
  end
40
63
 
41
- ActionView::Base.send :include, SimpleTableFor if defined? ActionView::Base
64
+ ActionView::Base.send :include, SimpleTableFor::Helpers if defined? ActionView::Base
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,6 @@
1
+ class PostsController < ApplicationController
2
+ def index
3
+ @posts = Post.all
4
+ render params[:template]
5
+ end
6
+ end
@@ -0,0 +1,2 @@
1
+ module PostsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class Post < ActiveRecord::Base
2
+ end
@@ -0,0 +1,5 @@
1
+ <%= table_for @posts, %w[Title Text Link] do |p| %>
2
+ <%= field p.title %>
3
+ <%= field p.text %>
4
+ <%= field link_to('View', p) %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= table_for @posts, %w[Title Text Link], id: 'the-id', class: 'the-class' do |p| %>
2
+ <%= field p.title, class: 'title' %>
3
+ <%= field p.text, class: 'text' %>
4
+ <%= field link_to('View', p), class: 'link' %>
5
+ <% end %>
@@ -1,4 +1,6 @@
1
1
  Rails.application.routes.draw do
2
+ resources :posts
3
+
2
4
  # The priority is based upon order of creation: first created -> highest priority.
3
5
  # See how all your routes lay out with "rake routes".
4
6
 
Binary file
@@ -0,0 +1,10 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title, null: false
5
+ t.text :text, null: false
6
+
7
+ t.timestamps null: false
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,23 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150330124236) do
15
+
16
+ create_table "posts", force: :cascade do |t|
17
+ t.string "title", null: false
18
+ t.text "text", null: false
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ end
Binary file
File without changes
@@ -0,0 +1,87 @@
1
+  (19.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (7.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreatePosts (20150330123943)
6
+  (0.1ms) begin transaction
7
+  (4.0ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar NOT NULL, "text" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
8
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150330123943"]]
9
+  (3.8ms) commit transaction
10
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
+  (6.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
12
+  (0.1ms) select sqlite_version(*)
13
+  (6.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
15
+ Migrating to CreatePosts (20150330124236)
16
+  (0.1ms) begin transaction
17
+  (3.9ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar NOT NULL, "text" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
18
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150330124236"]]
19
+  (3.2ms) commit transaction
20
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
21
+
22
+
23
+ Started GET "/" for 172.16.0.104 at 2015-03-30 09:55:31 -0300
24
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
+ Processing by Rails::WelcomeController#index as HTML
26
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/templates/rails/welcome/index.html.erb (6.7ms)
27
+ Completed 200 OK in 56ms (Views: 55.4ms | ActiveRecord: 0.0ms)
28
+
29
+
30
+ Started GET "/posts" for 172.16.0.104 at 2015-03-30 09:55:36 -0300
31
+ Processing by PostsController#index as HTML
32
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
33
+ Rendered posts/index.html.erb within layouts/application (5.9ms)
34
+ Completed 200 OK in 297ms (Views: 273.8ms | ActiveRecord: 3.7ms)
35
+
36
+
37
+ Started GET "/assets/posts-dfa7b291102a59957590b4e00e20f1c8.css?body=1" for 172.16.0.104 at 2015-03-30 09:55:36 -0300
38
+
39
+
40
+ Started GET "/assets/posts-46c9a194bd0668e67d57241f94473dc8.js?body=1" for 172.16.0.104 at 2015-03-30 09:55:37 -0300
41
+
42
+
43
+ Started GET "/assets/application-4bd47aa5304440469cdae59cbeafed2c.css?body=1" for 172.16.0.104 at 2015-03-30 09:55:37 -0300
44
+
45
+
46
+ Started GET "/assets/application-5443590960d4ffbddd98865912808a33.js?body=1" for 172.16.0.104 at 2015-03-30 09:55:37 -0300
47
+
48
+
49
+ Started GET "/posts" for 172.16.0.104 at 2015-03-30 10:57:40 -0300
50
+ ActiveRecord::SchemaMigration Load (2.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
51
+
52
+ ActionController::RoutingError (No route matches [GET] "/posts"):
53
+ actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
54
+ actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
55
+ railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'
56
+ railties (4.2.1) lib/rails/rack/logger.rb:20:in `block in call'
57
+ activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
58
+ activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:in `tagged'
59
+ activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `tagged'
60
+ railties (4.2.1) lib/rails/rack/logger.rb:20:in `call'
61
+ actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
62
+ rack (1.6.0) lib/rack/methodoverride.rb:22:in `call'
63
+ rack (1.6.0) lib/rack/runtime.rb:18:in `call'
64
+ activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
65
+ rack (1.6.0) lib/rack/lock.rb:17:in `call'
66
+ actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:in `call'
67
+ rack (1.6.0) lib/rack/sendfile.rb:113:in `call'
68
+ railties (4.2.1) lib/rails/engine.rb:518:in `call'
69
+ railties (4.2.1) lib/rails/application.rb:164:in `call'
70
+ rack (1.6.0) lib/rack/lock.rb:17:in `call'
71
+ rack (1.6.0) lib/rack/content_length.rb:15:in `call'
72
+ rack (1.6.0) lib/rack/handler/webrick.rb:89:in `service'
73
+ /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
74
+ /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
75
+ /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
76
+
77
+
78
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.3ms)
79
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/routes/_route.html.erb (1.1ms)
80
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/routes/_table.html.erb (32.0ms)
81
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (23.0ms)
82
+ Rendered /home/ubuntu/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb within rescues/layout (101.1ms)
83
+
84
+
85
+ Started GET "/posts/render" for 172.16.0.104 at 2015-03-30 10:57:44 -0300
86
+ Processing by PostsController#render as HTML
87
+ Completed 200 OK in 19ms (ActiveRecord: 0.0ms)
@@ -3,3 +3,503 @@
3
3
  SimpleTableForTest: test_truth
4
4
  ------------------------------
5
5
   (0.1ms) rollback transaction
6
+  (6.3ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar NOT NULL, "text" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
7
+  (13.1ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
8
+  (0.5ms) select sqlite_version(*)
9
+  (7.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
10
+  (1.5ms) SELECT version FROM "schema_migrations"
11
+  (8.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20150330124236')
12
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
+  (0.1ms) begin transaction
14
+ ---------------------------------------------
15
+ PostsControllerTest: test_should_render_table
16
+ ---------------------------------------------
17
+  (0.5ms) rollback transaction
18
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
19
+  (0.1ms) begin transaction
20
+ ---------------------------------------------
21
+ PostsControllerTest: test_should_render_table
22
+ ---------------------------------------------
23
+  (0.1ms) rollback transaction
24
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
25
+  (0.2ms) begin transaction
26
+ ---------------------------------------------
27
+ PostsControllerTest: test_should_render_table
28
+ ---------------------------------------------
29
+ Processing by PostsController#index as HTML
30
+ Completed 500 Internal Server Error in 53ms (ActiveRecord: 0.0ms)
31
+  (0.1ms) rollback transaction
32
+ ActiveRecord::SchemaMigration Load (2.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
33
+  (0.2ms) begin transaction
34
+ ---------------------------------------------
35
+ PostsControllerTest: test_should_render_table
36
+ ---------------------------------------------
37
+ Processing by PostsController#index as HTML
38
+ Rendered posts/index.html.erb within layouts/application (6.3ms)
39
+ Completed 200 OK in 187ms (Views: 186.9ms | ActiveRecord: 0.0ms)
40
+  (0.1ms) rollback transaction
41
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
42
+  (0.2ms) begin transaction
43
+ ---------------------------------------------
44
+ PostsControllerTest: test_should_render_table
45
+ ---------------------------------------------
46
+ Processing by PostsController#index as HTML
47
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
48
+ Rendered posts/index.html.erb within layouts/application (9.3ms)
49
+ Completed 200 OK in 141ms (Views: 122.1ms | ActiveRecord: 1.8ms)
50
+  (0.1ms) rollback transaction
51
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
52
+  (0.2ms) begin transaction
53
+ ---------------------------------------------
54
+ PostsControllerTest: test_should_render_table
55
+ ---------------------------------------------
56
+ Processing by PostsController#index as HTML
57
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
58
+ Rendered posts/index.html.erb within layouts/application (9.1ms)
59
+ Completed 200 OK in 145ms (Views: 126.0ms | ActiveRecord: 1.8ms)
60
+  (0.1ms) rollback transaction
61
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
62
+  (0.3ms) begin transaction
63
+ ---------------------------------------------
64
+ PostsControllerTest: test_should_render_table
65
+ ---------------------------------------------
66
+ Processing by PostsController#index as HTML
67
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
68
+ Rendered posts/index.html.erb within layouts/application (8.8ms)
69
+ Completed 200 OK in 129ms (Views: 109.9ms | ActiveRecord: 1.7ms)
70
+  (0.1ms) rollback transaction
71
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
72
+  (0.2ms) begin transaction
73
+ ---------------------------------------------
74
+ PostsControllerTest: test_should_render_table
75
+ ---------------------------------------------
76
+ Processing by PostsController#index as HTML
77
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
78
+ Rendered posts/index.html.erb within layouts/application (9.1ms)
79
+ Completed 200 OK in 130ms (Views: 110.5ms | ActiveRecord: 1.7ms)
80
+  (0.1ms) rollback transaction
81
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
82
+  (0.2ms) begin transaction
83
+ ---------------------------------------------
84
+ PostsControllerTest: test_should_render_table
85
+ ---------------------------------------------
86
+ Processing by PostsController#index as HTML
87
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
88
+ Rendered posts/index.html.erb within layouts/application (8.9ms)
89
+ Completed 200 OK in 129ms (Views: 110.2ms | ActiveRecord: 1.7ms)
90
+  (0.1ms) rollback transaction
91
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
92
+  (0.1ms) begin transaction
93
+ ---------------------------------------------
94
+ PostsControllerTest: test_should_render_table
95
+ ---------------------------------------------
96
+ Processing by PostsController#index as HTML
97
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
98
+ Rendered posts/index.html.erb within layouts/application (8.9ms)
99
+ Completed 200 OK in 130ms (Views: 110.7ms | ActiveRecord: 1.8ms)
100
+  (0.1ms) rollback transaction
101
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
102
+  (0.1ms) begin transaction
103
+ ---------------------------------------------
104
+ PostsControllerTest: test_should_render_table
105
+ ---------------------------------------------
106
+ Processing by PostsController#index as HTML
107
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
108
+ Rendered posts/index.html.erb within layouts/application (8.9ms)
109
+ Completed 200 OK in 129ms (Views: 110.0ms | ActiveRecord: 1.7ms)
110
+  (0.1ms) rollback transaction
111
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
112
+  (0.2ms) begin transaction
113
+ ---------------------------------------------
114
+ PostsControllerTest: test_should_render_table
115
+ ---------------------------------------------
116
+ Processing by PostsController#index as HTML
117
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
118
+ Rendered posts/index.html.erb within layouts/application (8.6ms)
119
+ Completed 200 OK in 131ms (Views: 111.3ms | ActiveRecord: 1.8ms)
120
+  (0.1ms) rollback transaction
121
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
122
+  (0.2ms) begin transaction
123
+ ---------------------------------------------
124
+ PostsControllerTest: test_should_render_table
125
+ ---------------------------------------------
126
+ Processing by PostsController#index as HTML
127
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
128
+ Rendered posts/index.html.erb within layouts/application (9.0ms)
129
+ Completed 200 OK in 131ms (Views: 111.5ms | ActiveRecord: 1.7ms)
130
+  (0.1ms) rollback transaction
131
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
132
+  (0.2ms) begin transaction
133
+ ---------------------------------------------
134
+ PostsControllerTest: test_should_render_table
135
+ ---------------------------------------------
136
+ Processing by PostsController#index as HTML
137
+ Post Load (2.4ms) SELECT "posts".* FROM "posts"
138
+ Rendered posts/index.html.erb within layouts/application (12.9ms)
139
+ Completed 200 OK in 173ms (Views: 148.7ms | ActiveRecord: 2.5ms)
140
+  (0.1ms) rollback transaction
141
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
142
+  (0.2ms) begin transaction
143
+ ---------------------------------------------
144
+ PostsControllerTest: test_should_render_table
145
+ ---------------------------------------------
146
+ Processing by PostsController#index as HTML
147
+ Post Load (2.1ms) SELECT "posts".* FROM "posts"
148
+ Rendered posts/index.html.erb within layouts/application (10.1ms)
149
+ Completed 200 OK in 145ms (Views: 125.9ms | ActiveRecord: 2.2ms)
150
+  (0.2ms) rollback transaction
151
+ ActiveRecord::SchemaMigration Load (2.0ms) SELECT "schema_migrations".* FROM "schema_migrations"
152
+  (0.2ms) begin transaction
153
+ ---------------------------------------------
154
+ PostsControllerTest: test_should_render_table
155
+ ---------------------------------------------
156
+ Processing by PostsController#index as HTML
157
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
158
+ Rendered posts/index.html.erb within layouts/application (8.9ms)
159
+ Completed 200 OK in 131ms (Views: 111.7ms | ActiveRecord: 1.6ms)
160
+  (0.2ms) rollback transaction
161
+  (6.7ms) CREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar NOT NULL, "text" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
162
+  (6.5ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL)
163
+  (0.1ms) select sqlite_version(*)
164
+  (7.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
165
+  (2.1ms) SELECT version FROM "schema_migrations"
166
+  (6.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20150330124236')
167
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
168
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
169
+  (0.2ms) begin transaction
170
+ ---------------------------------------------
171
+ PostsControllerTest: test_should_render_table
172
+ ---------------------------------------------
173
+ Processing by PostsController#index as HTML
174
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
175
+ Rendered posts/index.html.erb within layouts/application (9.2ms)
176
+ Completed 200 OK in 129ms (Views: 109.8ms | ActiveRecord: 1.7ms)
177
+  (0.0ms) rollback transaction
178
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
179
+  (0.2ms) begin transaction
180
+ ---------------------------------------------
181
+ PostsControllerTest: test_should_render_table
182
+ ---------------------------------------------
183
+ Processing by PostsController#index as HTML
184
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
185
+ Rendered posts/index.html.erb within layouts/application (6.2ms)
186
+ Completed 200 OK in 133ms (Views: 113.0ms | ActiveRecord: 1.7ms)
187
+  (0.1ms) rollback transaction
188
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
189
+  (0.2ms) begin transaction
190
+ ---------------------------------------------
191
+ PostsControllerTest: test_should_render_table
192
+ ---------------------------------------------
193
+ Processing by PostsController#index as HTML
194
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
195
+ Rendered posts/index.html.erb within layouts/application (6.3ms)
196
+ Completed 200 OK in 134ms (Views: 113.1ms | ActiveRecord: 1.7ms)
197
+  (0.1ms) rollback transaction
198
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
199
+  (0.1ms) begin transaction
200
+ Fixture Delete (2.5ms) DELETE FROM "posts"
201
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:25:06', '2015-03-30 13:25:06', 980190962)
202
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:25:06', '2015-03-30 13:25:06', 298486374)
203
+  (3.1ms) commit transaction
204
+  (0.1ms) begin transaction
205
+ ---------------------------------------------
206
+ PostsControllerTest: test_should_render_table
207
+ ---------------------------------------------
208
+ Processing by PostsController#index as HTML
209
+ Post Load (1.7ms) SELECT "posts".* FROM "posts"
210
+ Rendered posts/index.html.erb within layouts/application (6.7ms)
211
+ Completed 200 OK in 119ms (Views: 111.7ms | ActiveRecord: 1.7ms)
212
+  (0.1ms) rollback transaction
213
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
214
+  (0.2ms) begin transaction
215
+ Fixture Delete (2.3ms) DELETE FROM "posts"
216
+ Fixture Insert (0.9ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:25:43', '2015-03-30 13:25:43', 980190962)
217
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:25:43', '2015-03-30 13:25:43', 298486374)
218
+  (3.3ms) commit transaction
219
+  (0.1ms) begin transaction
220
+ ---------------------------------------------
221
+ PostsControllerTest: test_should_render_table
222
+ ---------------------------------------------
223
+ Processing by PostsController#index as HTML
224
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
225
+ Rendered posts/index.html.erb within layouts/application (12.4ms)
226
+ Completed 200 OK in 118ms (Views: 115.7ms | ActiveRecord: 1.5ms)
227
+  (0.1ms) rollback transaction
228
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
229
+  (0.1ms) begin transaction
230
+ Fixture Delete (2.5ms) DELETE FROM "posts"
231
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:40:04', '2015-03-30 13:40:04', 980190962)
232
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:40:04', '2015-03-30 13:40:04', 298486374)
233
+  (2.9ms) commit transaction
234
+  (0.1ms) begin transaction
235
+ ---------------------------------------------
236
+ PostsControllerTest: test_should_render_table
237
+ ---------------------------------------------
238
+ Processing by PostsController#index as HTML
239
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
240
+ Rendered posts/index.html.erb within layouts/application (13.3ms)
241
+ Completed 200 OK in 122ms (Views: 120.0ms | ActiveRecord: 1.5ms)
242
+  (0.1ms) rollback transaction
243
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
244
+  (0.1ms) begin transaction
245
+ Fixture Delete (2.3ms) DELETE FROM "posts"
246
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:42:40', '2015-03-30 13:42:40', 980190962)
247
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:42:40', '2015-03-30 13:42:40', 298486374)
248
+  (3.4ms) commit transaction
249
+  (0.1ms) begin transaction
250
+ ---------------------------------------------
251
+ PostsControllerTest: test_should_render_table
252
+ ---------------------------------------------
253
+ Processing by PostsController#index as HTML
254
+ Post Load (1.3ms) SELECT "posts".* FROM "posts"
255
+ Rendered posts/index.html.erb within layouts/application (12.4ms)
256
+ Completed 200 OK in 119ms (Views: 116.9ms | ActiveRecord: 1.3ms)
257
+  (0.1ms) rollback transaction
258
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
259
+  (0.1ms) begin transaction
260
+ Fixture Delete (2.5ms) DELETE FROM "posts"
261
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:52:32', '2015-03-30 13:52:32', 980190962)
262
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:52:32', '2015-03-30 13:52:32', 298486374)
263
+  (3.0ms) commit transaction
264
+  (0.1ms) begin transaction
265
+ ----------------------------------------------------------
266
+ PostsControllerTest: test_should_render_table_with_default
267
+ ----------------------------------------------------------
268
+  (0.1ms) rollback transaction
269
+  (0.2ms) begin transaction
270
+ ---------------------------------------------
271
+ PostsControllerTest: test_should_render_table
272
+ ---------------------------------------------
273
+ Processing by PostsController#render as HTML
274
+ Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
275
+  (0.1ms) rollback transaction
276
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
277
+  (0.1ms) begin transaction
278
+ Fixture Delete (2.3ms) DELETE FROM "posts"
279
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:54:42', '2015-03-30 13:54:42', 980190962)
280
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:54:42', '2015-03-30 13:54:42', 298486374)
281
+  (3.0ms) commit transaction
282
+  (0.1ms) begin transaction
283
+ ----------------------------------------------------------
284
+ PostsControllerTest: test_should_render_table_with_default
285
+ ----------------------------------------------------------
286
+  (0.1ms) rollback transaction
287
+  (0.1ms) begin transaction
288
+ ---------------------------------------------
289
+ PostsControllerTest: test_should_render_table
290
+ ---------------------------------------------
291
+ Processing by PostsController#render as HTML
292
+ Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
293
+  (0.1ms) rollback transaction
294
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
295
+  (0.1ms) begin transaction
296
+ Fixture Delete (2.8ms) DELETE FROM "posts"
297
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:55:42', '2015-03-30 13:55:42', 980190962)
298
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:55:42', '2015-03-30 13:55:42', 298486374)
299
+  (2.9ms) commit transaction
300
+  (0.1ms) begin transaction
301
+ ----------------------------------------------------------
302
+ PostsControllerTest: test_should_render_table_with_default
303
+ ----------------------------------------------------------
304
+  (0.1ms) rollback transaction
305
+  (0.1ms) begin transaction
306
+ ---------------------------------------------
307
+ PostsControllerTest: test_should_render_table
308
+ ---------------------------------------------
309
+ Processing by PostsController#render as HTML
310
+ Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
311
+  (0.1ms) rollback transaction
312
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
313
+  (0.2ms) begin transaction
314
+ Fixture Delete (2.4ms) DELETE FROM "posts"
315
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:58:52', '2015-03-30 13:58:52', 980190962)
316
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 13:58:52', '2015-03-30 13:58:52', 298486374)
317
+  (3.1ms) commit transaction
318
+  (0.1ms) begin transaction
319
+ ---------------------------------------------
320
+ PostsControllerTest: test_should_render_table
321
+ ---------------------------------------------
322
+  (0.1ms) rollback transaction
323
+  (0.1ms) begin transaction
324
+ ----------------------------------------------------------
325
+ PostsControllerTest: test_should_render_table_with_default
326
+ ----------------------------------------------------------
327
+  (0.2ms) rollback transaction
328
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
329
+  (0.2ms) begin transaction
330
+ Fixture Delete (2.4ms) DELETE FROM "posts"
331
+ Fixture Insert (0.5ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:00:04', '2015-03-30 14:00:04', 980190962)
332
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:00:04', '2015-03-30 14:00:04', 298486374)
333
+  (2.9ms) commit transaction
334
+  (0.1ms) begin transaction
335
+ ---------------------------------------------
336
+ PostsControllerTest: test_should_render_table
337
+ ---------------------------------------------
338
+  (0.1ms) rollback transaction
339
+  (0.1ms) begin transaction
340
+ ----------------------------------------------------------
341
+ PostsControllerTest: test_should_render_table_with_default
342
+ ----------------------------------------------------------
343
+  (0.1ms) rollback transaction
344
+ ActiveRecord::SchemaMigration Load (1.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
345
+  (0.2ms) begin transaction
346
+ Fixture Delete (2.5ms) DELETE FROM "posts"
347
+ Fixture Insert (0.4ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:00:57', '2015-03-30 14:00:57', 980190962)
348
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:00:57', '2015-03-30 14:00:57', 298486374)
349
+  (3.3ms) commit transaction
350
+  (0.1ms) begin transaction
351
+ ---------------------------------------------
352
+ PostsControllerTest: test_should_render_table
353
+ ---------------------------------------------
354
+ Processing by PostsController#render as HTML
355
+ Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
356
+  (0.1ms) rollback transaction
357
+  (0.1ms) begin transaction
358
+ ----------------------------------------------------------
359
+ PostsControllerTest: test_should_render_table_with_default
360
+ ----------------------------------------------------------
361
+  (0.1ms) rollback transaction
362
+ ActiveRecord::SchemaMigration Load (1.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
363
+  (0.1ms) begin transaction
364
+ Fixture Delete (2.4ms) DELETE FROM "posts"
365
+ Fixture Insert (0.7ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:01:58', '2015-03-30 14:01:58', 980190962)
366
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:01:58', '2015-03-30 14:01:58', 298486374)
367
+  (3.4ms) commit transaction
368
+  (0.1ms) begin transaction
369
+ ---------------------------------------------
370
+ PostsControllerTest: test_should_render_table
371
+ ---------------------------------------------
372
+ Processing by PostsController#index as HTML
373
+ Parameters: {"template"=>"render"}
374
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
375
+ Rendered posts/render.html.erb within layouts/application (13.4ms)
376
+ Completed 200 OK in 122ms (Views: 120.5ms | ActiveRecord: 1.6ms)
377
+  (0.1ms) rollback transaction
378
+  (0.1ms) begin transaction
379
+ ----------------------------------------------------------
380
+ PostsControllerTest: test_should_render_table_with_default
381
+ ----------------------------------------------------------
382
+  (0.1ms) rollback transaction
383
+ ActiveRecord::SchemaMigration Load (1.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
384
+  (0.1ms) begin transaction
385
+ Fixture Delete (2.5ms) DELETE FROM "posts"
386
+ Fixture Insert (0.5ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:04:22', '2015-03-30 14:04:22', 980190962)
387
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:04:22', '2015-03-30 14:04:22', 298486374)
388
+  (3.3ms) commit transaction
389
+  (0.1ms) begin transaction
390
+ ----------------------------------------------------------
391
+ PostsControllerTest: test_should_render_table_with_default
392
+ ----------------------------------------------------------
393
+  (0.1ms) rollback transaction
394
+  (0.1ms) begin transaction
395
+ ---------------------------------------------
396
+ PostsControllerTest: test_should_render_table
397
+ ---------------------------------------------
398
+ Processing by PostsController#index as HTML
399
+ Parameters: {"template"=>"render"}
400
+ Post Load (1.4ms) SELECT "posts".* FROM "posts"
401
+ Rendered posts/render.html.erb within layouts/application (12.5ms)
402
+ Completed 200 OK in 122ms (Views: 120.3ms | ActiveRecord: 1.4ms)
403
+  (0.1ms) rollback transaction
404
+ ActiveRecord::SchemaMigration Load (1.7ms) SELECT "schema_migrations".* FROM "schema_migrations"
405
+  (0.1ms) begin transaction
406
+ Fixture Delete (2.4ms) DELETE FROM "posts"
407
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:05:04', '2015-03-30 14:05:04', 980190962)
408
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:05:04', '2015-03-30 14:05:04', 298486374)
409
+  (3.3ms) commit transaction
410
+  (0.1ms) begin transaction
411
+ ---------------------------------------------
412
+ PostsControllerTest: test_should_render_table
413
+ ---------------------------------------------
414
+ Processing by PostsController#index as HTML
415
+ Parameters: {"template"=>"render"}
416
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
417
+ Rendered posts/render.html.erb within layouts/application (12.2ms)
418
+ Completed 200 OK in 119ms (Views: 117.3ms | ActiveRecord: 1.6ms)
419
+  (0.1ms) rollback transaction
420
+  (0.1ms) begin transaction
421
+ ----------------------------------------------------------
422
+ PostsControllerTest: test_should_render_table_with_default
423
+ ----------------------------------------------------------
424
+ Processing by PostsController#index as HTML
425
+ Parameters: {"template"=>"defaults"}
426
+ Completed 500 Internal Server Error in 32ms (ActiveRecord: 0.0ms)
427
+  (0.1ms) rollback transaction
428
+ ActiveRecord::SchemaMigration Load (1.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
429
+  (0.1ms) begin transaction
430
+ Fixture Delete (2.6ms) DELETE FROM "posts"
431
+ Fixture Insert (0.6ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:05:59', '2015-03-30 14:05:59', 980190962)
432
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:05:59', '2015-03-30 14:05:59', 298486374)
433
+  (3.1ms) commit transaction
434
+  (0.1ms) begin transaction
435
+ ---------------------------------------------
436
+ PostsControllerTest: test_should_render_table
437
+ ---------------------------------------------
438
+ Processing by PostsController#index as HTML
439
+ Parameters: {"template"=>"render"}
440
+ Post Load (1.6ms) SELECT "posts".* FROM "posts"
441
+ Rendered posts/render.html.erb within layouts/application (12.6ms)
442
+ Completed 200 OK in 119ms (Views: 116.7ms | ActiveRecord: 1.6ms)
443
+  (0.1ms) rollback transaction
444
+  (0.1ms) begin transaction
445
+ ----------------------------------------------------------
446
+ PostsControllerTest: test_should_render_table_with_default
447
+ ----------------------------------------------------------
448
+ Processing by PostsController#index as HTML
449
+ Parameters: {"template"=>"defaults"}
450
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
451
+ Rendered posts/defaults.html.erb within layouts/application (3.1ms)
452
+ Completed 200 OK in 20ms (Views: 18.5ms | ActiveRecord: 1.5ms)
453
+  (0.1ms) rollback transaction
454
+ ActiveRecord::SchemaMigration Load (1.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
455
+  (0.2ms) begin transaction
456
+ Fixture Delete (2.4ms) DELETE FROM "posts"
457
+ Fixture Insert (0.5ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:07:10', '2015-03-30 14:07:10', 980190962)
458
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:07:10', '2015-03-30 14:07:10', 298486374)
459
+  (3.3ms) commit transaction
460
+  (0.1ms) begin transaction
461
+ ---------------------------------------------
462
+ PostsControllerTest: test_should_render_table
463
+ ---------------------------------------------
464
+ Processing by PostsController#index as HTML
465
+ Parameters: {"template"=>"render"}
466
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
467
+ Rendered posts/render.html.erb within layouts/application (12.2ms)
468
+ Completed 200 OK in 119ms (Views: 117.4ms | ActiveRecord: 1.5ms)
469
+  (0.1ms) rollback transaction
470
+  (0.1ms) begin transaction
471
+ ----------------------------------------------------------
472
+ PostsControllerTest: test_should_render_table_with_default
473
+ ----------------------------------------------------------
474
+ Processing by PostsController#index as HTML
475
+ Parameters: {"template"=>"defaults"}
476
+ Post Load (1.8ms) SELECT "posts".* FROM "posts"
477
+ Rendered posts/defaults.html.erb within layouts/application (3.4ms)
478
+ Completed 200 OK in 20ms (Views: 18.4ms | ActiveRecord: 1.8ms)
479
+  (0.1ms) rollback transaction
480
+ ActiveRecord::SchemaMigration Load (1.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
481
+  (0.1ms) begin transaction
482
+ Fixture Delete (3.1ms) DELETE FROM "posts"
483
+ Fixture Insert (0.7ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:14:09', '2015-03-30 14:14:09', 980190962)
484
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("title", "text", "created_at", "updated_at", "id") VALUES ('MyString', 'MyText', '2015-03-30 14:14:09', '2015-03-30 14:14:09', 298486374)
485
+  (3.3ms) commit transaction
486
+  (0.1ms) begin transaction
487
+ ---------------------------------------------
488
+ PostsControllerTest: test_should_render_table
489
+ ---------------------------------------------
490
+ Processing by PostsController#index as HTML
491
+ Parameters: {"template"=>"render"}
492
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
493
+ Rendered posts/render.html.erb within layouts/application (12.7ms)
494
+ Completed 200 OK in 120ms (Views: 118.4ms | ActiveRecord: 1.5ms)
495
+  (0.1ms) rollback transaction
496
+  (0.1ms) begin transaction
497
+ -----------------------------------------------------------
498
+ PostsControllerTest: test_should_render_table_with_defaults
499
+ -----------------------------------------------------------
500
+ Processing by PostsController#index as HTML
501
+ Parameters: {"template"=>"defaults"}
502
+ Post Load (1.5ms) SELECT "posts".* FROM "posts"
503
+ Rendered posts/defaults.html.erb within layouts/application (3.1ms)
504
+ Completed 200 OK in 21ms (Views: 18.8ms | ActiveRecord: 1.5ms)
505
+  (0.1ms) rollback transaction
@@ -0,0 +1,46 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionController::TestCase
4
+ test 'should render table' do
5
+ get :index, template: :render
6
+
7
+ assert_select 'table#the-id.the-class' do
8
+ assert_select 'thead' do
9
+ assert_select 'tr' do
10
+ assert_select 'th'
11
+ end
12
+ end
13
+
14
+ assert_select 'tbody' do
15
+ assert_select 'tr' do
16
+ assert_select 'td.title'
17
+ assert_select 'td.text'
18
+ assert_select 'td.link'
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ test 'should render table with defaults' do
25
+ old_defaults = SimpleTableFor::Defaults.get
26
+ SimpleTableFor::Defaults.set({id: 'default-id', class: 'default-class'})
27
+
28
+ get :index, template: :defaults
29
+
30
+ assert_select 'table#default-id.default-class' do
31
+ assert_select 'thead' do
32
+ assert_select 'tr' do
33
+ assert_select 'th'
34
+ end
35
+ end
36
+
37
+ assert_select 'tbody' do
38
+ assert_select 'tr' do
39
+ assert_select 'td'
40
+ end
41
+ end
42
+ end
43
+
44
+ SimpleTableFor::Defaults.set old_defaults
45
+ end
46
+ end
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ title: MyString
5
+ text: MyText
6
+
7
+ two:
8
+ title: MyString
9
+ text: MyText
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ one:
4
+ title: MyString
5
+ text: MyText
6
+
7
+ two:
8
+ title: MyString
9
+ text: MyText
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_table_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Nering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-27 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sqlite3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rails
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -40,10 +54,17 @@ files:
40
54
  - test/dummy/README.rdoc
41
55
  - test/dummy/Rakefile
42
56
  - test/dummy/app/assets/javascripts/application.js
57
+ - test/dummy/app/assets/javascripts/posts.js
43
58
  - test/dummy/app/assets/stylesheets/application.css
59
+ - test/dummy/app/assets/stylesheets/posts.css
44
60
  - test/dummy/app/controllers/application_controller.rb
61
+ - test/dummy/app/controllers/posts_controller.rb
45
62
  - test/dummy/app/helpers/application_helper.rb
63
+ - test/dummy/app/helpers/posts_helper.rb
64
+ - test/dummy/app/models/post.rb
46
65
  - test/dummy/app/views/layouts/application.html.erb
66
+ - test/dummy/app/views/posts/defaults.html.erb
67
+ - test/dummy/app/views/posts/render.html.erb
47
68
  - test/dummy/bin/bundle
48
69
  - test/dummy/bin/rails
49
70
  - test/dummy/bin/rake
@@ -67,12 +88,43 @@ files:
67
88
  - test/dummy/config/locales/en.yml
68
89
  - test/dummy/config/routes.rb
69
90
  - test/dummy/config/secrets.yml
91
+ - test/dummy/db/development.sqlite3
92
+ - test/dummy/db/migrate/20150330124236_create_posts.rb
93
+ - test/dummy/db/schema.rb
70
94
  - test/dummy/db/test.sqlite3
95
+ - test/dummy/log/RAILS_ENV=test.log
96
+ - test/dummy/log/development.log
71
97
  - test/dummy/log/test.log
72
98
  - test/dummy/public/404.html
73
99
  - test/dummy/public/422.html
74
100
  - test/dummy/public/500.html
75
101
  - test/dummy/public/favicon.ico
102
+ - test/dummy/test/controllers/posts_controller_test.rb
103
+ - test/dummy/test/fixtures/posts.yml
104
+ - test/dummy/test/models/post_test.rb
105
+ - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
106
+ - test/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1
107
+ - test/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f
108
+ - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
109
+ - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
110
+ - test/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6
111
+ - test/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4
112
+ - test/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
113
+ - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
114
+ - test/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145
115
+ - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
116
+ - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
117
+ - test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
118
+ - test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
119
+ - test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
120
+ - test/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6
121
+ - test/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4
122
+ - test/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
123
+ - test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
124
+ - test/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145
125
+ - test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
126
+ - test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
127
+ - test/fixtures/posts.yml
76
128
  - test/simple_table_for_test.rb
77
129
  - test/test_helper.rb
78
130
  homepage: https://github.com/andreynering/simple_table_for
@@ -101,10 +153,17 @@ specification_version: 4
101
153
  summary: Simple way of creating tables in Rails
102
154
  test_files:
103
155
  - test/dummy/app/assets/javascripts/application.js
156
+ - test/dummy/app/assets/javascripts/posts.js
104
157
  - test/dummy/app/assets/stylesheets/application.css
158
+ - test/dummy/app/assets/stylesheets/posts.css
105
159
  - test/dummy/app/controllers/application_controller.rb
160
+ - test/dummy/app/controllers/posts_controller.rb
106
161
  - test/dummy/app/helpers/application_helper.rb
162
+ - test/dummy/app/helpers/posts_helper.rb
163
+ - test/dummy/app/models/post.rb
107
164
  - test/dummy/app/views/layouts/application.html.erb
165
+ - test/dummy/app/views/posts/defaults.html.erb
166
+ - test/dummy/app/views/posts/render.html.erb
108
167
  - test/dummy/bin/bundle
109
168
  - test/dummy/bin/rails
110
169
  - test/dummy/bin/rake
@@ -128,7 +187,12 @@ test_files:
128
187
  - test/dummy/config/routes.rb
129
188
  - test/dummy/config/secrets.yml
130
189
  - test/dummy/config.ru
190
+ - test/dummy/db/development.sqlite3
191
+ - test/dummy/db/migrate/20150330124236_create_posts.rb
192
+ - test/dummy/db/schema.rb
131
193
  - test/dummy/db/test.sqlite3
194
+ - test/dummy/log/development.log
195
+ - test/dummy/log/RAILS_ENV=test.log
132
196
  - test/dummy/log/test.log
133
197
  - test/dummy/public/404.html
134
198
  - test/dummy/public/422.html
@@ -136,5 +200,31 @@ test_files:
136
200
  - test/dummy/public/favicon.ico
137
201
  - test/dummy/Rakefile
138
202
  - test/dummy/README.rdoc
203
+ - test/dummy/test/controllers/posts_controller_test.rb
204
+ - test/dummy/test/fixtures/posts.yml
205
+ - test/dummy/test/models/post_test.rb
206
+ - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
207
+ - test/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1
208
+ - test/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f
209
+ - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
210
+ - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
211
+ - test/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6
212
+ - test/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4
213
+ - test/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
214
+ - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
215
+ - test/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145
216
+ - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
217
+ - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
218
+ - test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705
219
+ - test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af
220
+ - test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953
221
+ - test/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6
222
+ - test/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4
223
+ - test/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b
224
+ - test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994
225
+ - test/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145
226
+ - test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6
227
+ - test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655
228
+ - test/fixtures/posts.yml
139
229
  - test/simple_table_for_test.rb
140
230
  - test/test_helper.rb