render_variant 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 (55) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +32 -0
  4. data/lib/render_variant/partial_variant_extension.rb +20 -0
  5. data/lib/render_variant/railtie.rb +9 -0
  6. data/lib/render_variant/version.rb +3 -0
  7. data/lib/render_variant.rb +6 -0
  8. data/lib/tasks/render_variant_tasks.rake +4 -0
  9. data/test/dummy/README.rdoc +28 -0
  10. data/test/dummy/Rakefile +6 -0
  11. data/test/dummy/app/assets/javascripts/application.js +13 -0
  12. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  13. data/test/dummy/app/controllers/application_controller.rb +5 -0
  14. data/test/dummy/app/controllers/test_objs_controller.rb +10 -0
  15. data/test/dummy/app/helpers/application_helper.rb +2 -0
  16. data/test/dummy/app/models/test_obj.rb +2 -0
  17. data/test/dummy/app/views/layouts/application.html.erb +11 -0
  18. data/test/dummy/app/views/test_objs/_test_obj.html.erb +1 -0
  19. data/test/dummy/app/views/test_objs/_test_obj_medium.html.erb +1 -0
  20. data/test/dummy/app/views/test_objs/_test_obj_small.html.erb +1 -0
  21. data/test/dummy/app/views/test_objs/index.html.erb +21 -0
  22. data/test/dummy/bin/bundle +3 -0
  23. data/test/dummy/bin/rails +4 -0
  24. data/test/dummy/bin/rake +4 -0
  25. data/test/dummy/config/application.rb +23 -0
  26. data/test/dummy/config/boot.rb +5 -0
  27. data/test/dummy/config/database.yml +25 -0
  28. data/test/dummy/config/environment.rb +5 -0
  29. data/test/dummy/config/environments/development.rb +29 -0
  30. data/test/dummy/config/environments/production.rb +80 -0
  31. data/test/dummy/config/environments/test.rb +36 -0
  32. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  34. data/test/dummy/config/initializers/inflections.rb +16 -0
  35. data/test/dummy/config/initializers/mime_types.rb +5 -0
  36. data/test/dummy/config/initializers/secret_token.rb +12 -0
  37. data/test/dummy/config/initializers/session_store.rb +3 -0
  38. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  39. data/test/dummy/config/locales/en.yml +23 -0
  40. data/test/dummy/config/routes.rb +58 -0
  41. data/test/dummy/config.ru +4 -0
  42. data/test/dummy/db/development.sqlite3 +0 -0
  43. data/test/dummy/db/migrate/20131206162427_create_test_objs.rb +9 -0
  44. data/test/dummy/db/schema.rb +23 -0
  45. data/test/dummy/db/test.sqlite3 +0 -0
  46. data/test/dummy/log/development.log +15 -0
  47. data/test/dummy/log/test.log +315 -0
  48. data/test/dummy/public/404.html +58 -0
  49. data/test/dummy/public/422.html +58 -0
  50. data/test/dummy/public/500.html +57 -0
  51. data/test/dummy/public/favicon.ico +0 -0
  52. data/test/dummy/test/fixtures/test_objs.yml +14 -0
  53. data/test/integration/test_objs_controller_test.rb +20 -0
  54. data/test/test_helper.rb +26 -0
  55. metadata +171 -0
@@ -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: 20131206162427) do
15
+
16
+ create_table "test_objs", force: true do |t|
17
+ t.string "name"
18
+ t.string "desc"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ end
Binary file
@@ -0,0 +1,15 @@
1
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateTestObjs (20131206162427)
5
+  (0.1ms) begin transaction
6
+  (0.3ms) CREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
7
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
8
+  (0.6ms) commit transaction
9
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
10
+  (1.7ms) CREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) 
11
+  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
12
+  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
13
+  (0.1ms) SELECT version FROM "schema_migrations"
14
+  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20131206162427')
15
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
@@ -0,0 +1,315 @@
1
+  (0.2ms) begin transaction
2
+  (0.1ms) rollback transaction
3
+  (0.0ms) begin transaction
4
+  (0.0ms) rollback transaction
5
+  (0.2ms) begin transaction
6
+  (0.0ms) rollback transaction
7
+  (0.0ms) begin transaction
8
+  (0.0ms) rollback transaction
9
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
10
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
11
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ Migrating to CreateTestObjs (20131206162427)
13
+  (0.1ms) begin transaction
14
+  (0.3ms) CREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime) 
15
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
16
+  (0.7ms) commit transaction
17
+  (0.1ms) begin transaction
18
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
19
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:32:14', '2013-12-06 17:32:14', 980190962)
20
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:32:14', '2013-12-06 17:32:14', 980190962)
21
+  (0.4ms) rollback transaction
22
+  (0.0ms) begin transaction
23
+ Fixture Delete (0.1ms) DELETE FROM "test_objs"
24
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:32:14', '2013-12-06 17:32:14', 980190962)
25
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:32:14', '2013-12-06 17:32:14', 980190962)
26
+  (0.3ms) rollback transaction
27
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
28
+  (0.1ms) begin transaction
29
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
30
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:23', '2013-12-06 17:33:23', 980190962)
31
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:23', '2013-12-06 17:33:23', 980190962)
32
+  (1.0ms) rollback transaction
33
+  (0.1ms) begin transaction
34
+ Fixture Delete (0.1ms) DELETE FROM "test_objs"
35
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:23', '2013-12-06 17:33:23', 980190962)
36
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:23', '2013-12-06 17:33:23', 980190962)
37
+  (0.3ms) rollback transaction
38
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
39
+  (0.1ms) begin transaction
40
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
41
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:47', '2013-12-06 17:33:47', 980190962)
42
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:47', '2013-12-06 17:33:47', 980190962)
43
+  (1.0ms) rollback transaction
44
+  (0.1ms) begin transaction
45
+ Fixture Delete (0.1ms) DELETE FROM "test_objs"
46
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:47', '2013-12-06 17:33:47', 980190962)
47
+ SQLite3::SQLException: table test_objs has no column named desc: INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:33:47', '2013-12-06 17:33:47', 980190962)
48
+  (0.4ms) rollback transaction
49
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
50
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
51
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
52
+ Migrating to CreateTestObjs (20131206162427)
53
+  (0.1ms) begin transaction
54
+  (0.2ms) CREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) 
55
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
56
+  (0.7ms) commit transaction
57
+  (0.1ms) begin transaction
58
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
59
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:34:19', '2013-12-06 17:34:19', 980190962)
60
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:34:19', '2013-12-06 17:34:19', 298486374)
61
+  (0.8ms) commit transaction
62
+  (0.0ms) begin transaction
63
+ -------------------------------------------------
64
+ TestObjsControllerTest: test_renders_with_variant
65
+ -------------------------------------------------
66
+  (0.1ms) rollback transaction
67
+  (0.1ms) begin transaction
68
+ ----------------------------------------------------
69
+ TestObjsControllerTest: test_renders_without_variant
70
+ ----------------------------------------------------
71
+  (0.0ms) rollback transaction
72
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
73
+  (0.0ms) begin transaction
74
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
75
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:35:25', '2013-12-06 17:35:25', 980190962)
76
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:35:25', '2013-12-06 17:35:25', 298486374)
77
+  (1.6ms) commit transaction
78
+  (0.1ms) begin transaction
79
+ -------------------------------------------------
80
+ TestObjsControllerTest: test_renders_with_variant
81
+ -------------------------------------------------
82
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:35:25 -0800
83
+ Processing by TestObjsController#index as HTML
84
+ Parameters: {"variant"=>"medium"}
85
+ Rendered test_objs/index.html.erb within layouts/application (1.9ms)
86
+ Completed 500 Internal Server Error in 4ms
87
+  (0.1ms) rollback transaction
88
+  (0.0ms) begin transaction
89
+ ----------------------------------------------------
90
+ TestObjsControllerTest: test_renders_without_variant
91
+ ----------------------------------------------------
92
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:35:25 -0800
93
+ Processing by TestObjsController#index as HTML
94
+ Completed 500 Internal Server Error in 1ms
95
+  (0.0ms) rollback transaction
96
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
97
+  (0.1ms) begin transaction
98
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
99
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:37:19', '2013-12-06 17:37:19', 980190962)
100
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:37:19', '2013-12-06 17:37:19', 298486374)
101
+  (1.0ms) commit transaction
102
+  (0.0ms) begin transaction
103
+ -------------------------------------------------
104
+ TestObjsControllerTest: test_renders_with_variant
105
+ -------------------------------------------------
106
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:37:19 -0800
107
+ Processing by TestObjsController#index as HTML
108
+ Parameters: {"variant"=>"medium"}
109
+ Rendered test_objs/index.html.erb within layouts/application (1.9ms)
110
+ Completed 500 Internal Server Error in 4ms
111
+  (0.1ms) rollback transaction
112
+  (0.0ms) begin transaction
113
+ ----------------------------------------------------
114
+ TestObjsControllerTest: test_renders_without_variant
115
+ ----------------------------------------------------
116
+  (0.1ms) SELECT COUNT(*) FROM "test_objs"
117
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:37:19 -0800
118
+ Processing by TestObjsController#index as HTML
119
+ Completed 500 Internal Server Error in 1ms
120
+  (0.0ms) rollback transaction
121
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
122
+  (0.1ms) begin transaction
123
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
124
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:38:19', '2013-12-06 17:38:19', 980190962)
125
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:38:19', '2013-12-06 17:38:19', 298486374)
126
+  (1.3ms) commit transaction
127
+  (0.1ms) begin transaction
128
+ -------------------------------------------------
129
+ TestObjsControllerTest: test_renders_with_variant
130
+ -------------------------------------------------
131
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:38:19 -0800
132
+ Processing by TestObjsController#index as HTML
133
+ Parameters: {"variant"=>"medium"}
134
+ Rendered test_objs/index.html.erb within layouts/application (1.9ms)
135
+ Completed 500 Internal Server Error in 4ms
136
+  (0.1ms) rollback transaction
137
+  (0.0ms) begin transaction
138
+ ----------------------------------------------------
139
+ TestObjsControllerTest: test_renders_without_variant
140
+ ----------------------------------------------------
141
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:38:19 -0800
142
+ Processing by TestObjsController#index as HTML
143
+ Completed 500 Internal Server Error in 1ms
144
+  (0.0ms) rollback transaction
145
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
146
+  (0.1ms) begin transaction
147
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
148
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:39:11', '2013-12-06 17:39:11', 980190962)
149
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:39:11', '2013-12-06 17:39:11', 298486374)
150
+  (1.5ms) commit transaction
151
+  (0.1ms) begin transaction
152
+ -------------------------------------------------
153
+ TestObjsControllerTest: test_renders_with_variant
154
+ -------------------------------------------------
155
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:39:11 -0800
156
+ Processing by TestObjsController#index as HTML
157
+ Parameters: {"variant"=>"medium"}
158
+ Rendered test_objs/index.html.erb within layouts/application (2.0ms)
159
+ Completed 500 Internal Server Error in 4ms
160
+  (0.1ms) rollback transaction
161
+  (0.1ms) begin transaction
162
+ ----------------------------------------------------
163
+ TestObjsControllerTest: test_renders_without_variant
164
+ ----------------------------------------------------
165
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:39:11 -0800
166
+ Processing by TestObjsController#index as HTML
167
+ Completed 500 Internal Server Error in 1ms
168
+  (0.0ms) rollback transaction
169
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
170
+  (0.1ms) begin transaction
171
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
172
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:39:41', '2013-12-06 17:39:41', 980190962)
173
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:39:41', '2013-12-06 17:39:41', 298486374)
174
+  (1.3ms) commit transaction
175
+  (0.1ms) begin transaction
176
+ -------------------------------------------------
177
+ TestObjsControllerTest: test_renders_with_variant
178
+ -------------------------------------------------
179
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:39:41 -0800
180
+ Processing by TestObjsController#index as HTML
181
+ Parameters: {"variant"=>"medium"}
182
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
183
+ Rendered test_objs/index.html.erb within layouts/application (5.6ms)
184
+ Completed 500 Internal Server Error in 8ms
185
+  (0.1ms) rollback transaction
186
+  (0.0ms) begin transaction
187
+ ----------------------------------------------------
188
+ TestObjsControllerTest: test_renders_without_variant
189
+ ----------------------------------------------------
190
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:39:41 -0800
191
+ Processing by TestObjsController#index as HTML
192
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
193
+ Completed 500 Internal Server Error in 2ms
194
+  (0.0ms) rollback transaction
195
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
196
+  (0.1ms) begin transaction
197
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
198
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:40:24', '2013-12-06 17:40:24', 980190962)
199
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:40:24', '2013-12-06 17:40:24', 298486374)
200
+  (1.5ms) commit transaction
201
+  (0.1ms) begin transaction
202
+ -------------------------------------------------
203
+ TestObjsControllerTest: test_renders_with_variant
204
+ -------------------------------------------------
205
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:40:24 -0800
206
+ Processing by TestObjsController#index as HTML
207
+ Parameters: {"variant"=>"medium"}
208
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
209
+ Rendered test_objs/_test_obj_medium.html.erb (0.3ms)
210
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
211
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
212
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
213
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
214
+ Rendered test_objs/index.html.erb within layouts/application (6.2ms)
215
+ Completed 200 OK in 9ms (Views: 8.5ms | ActiveRecord: 0.1ms)
216
+  (0.1ms) SELECT COUNT(*) FROM "test_objs"
217
+  (0.1ms) rollback transaction
218
+  (0.1ms) begin transaction
219
+ ----------------------------------------------------
220
+ TestObjsControllerTest: test_renders_without_variant
221
+ ----------------------------------------------------
222
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:40:24 -0800
223
+ Processing by TestObjsController#index as HTML
224
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
225
+ Rendered test_objs/_test_obj.html.erb (0.5ms)
226
+ Completed 500 Internal Server Error in 4ms
227
+  (0.0ms) rollback transaction
228
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
229
+  (0.1ms) begin transaction
230
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
231
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:41:04', '2013-12-06 17:41:04', 980190962)
232
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:41:04', '2013-12-06 17:41:04', 298486374)
233
+  (1.3ms) commit transaction
234
+  (0.1ms) begin transaction
235
+ -------------------------------------------------
236
+ TestObjsControllerTest: test_renders_with_variant
237
+ -------------------------------------------------
238
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:41:04 -0800
239
+ Processing by TestObjsController#index as HTML
240
+ Parameters: {"variant"=>"medium"}
241
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
242
+ Rendered test_objs/_test_obj_medium.html.erb (0.3ms)
243
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
244
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
245
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
246
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
247
+ Rendered test_objs/index.html.erb within layouts/application (6.2ms)
248
+ Completed 200 OK in 9ms (Views: 8.4ms | ActiveRecord: 0.1ms)
249
+  (0.1ms) SELECT COUNT(*) FROM "test_objs"
250
+  (0.1ms) rollback transaction
251
+  (0.0ms) begin transaction
252
+ ----------------------------------------------------
253
+ TestObjsControllerTest: test_renders_without_variant
254
+ ----------------------------------------------------
255
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:41:04 -0800
256
+ Processing by TestObjsController#index as HTML
257
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
258
+ Rendered test_objs/_test_obj.html.erb (0.4ms)
259
+ Rendered test_objs/_test_obj.html.erb (0.3ms)
260
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
261
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
262
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
263
+ Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.1ms)
264
+  (0.0ms) SELECT COUNT(*) FROM "test_objs"
265
+  (0.0ms) rollback transaction
266
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
267
+  (0.1ms) begin transaction
268
+ Fixture Delete (0.2ms) DELETE FROM "test_objs"
269
+ Fixture Insert (0.1ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-06 17:41:53', '2013-12-06 17:41:53', 980190962)
270
+ Fixture Insert (0.0ms) INSERT INTO "test_objs" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-06 17:41:53', '2013-12-06 17:41:53', 298486374)
271
+  (1.4ms) commit transaction
272
+  (0.1ms) begin transaction
273
+ -------------------------------------------------
274
+ TestObjsControllerTest: test_renders_with_variant
275
+ -------------------------------------------------
276
+ Started GET "/test_objs?variant=medium" for 127.0.0.1 at 2013-12-06 09:41:53 -0800
277
+ Processing by TestObjsController#index as HTML
278
+ Parameters: {"variant"=>"medium"}
279
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
280
+ Rendered test_objs/_test_obj_medium.html.erb (0.4ms)
281
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
282
+ Rendered test_objs/_test_obj_medium.html.erb (0.2ms)
283
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
284
+ Rendered test_objs/_test_obj_medium.html.erb (0.0ms)
285
+ Rendered test_objs/index.html.erb within layouts/application (6.7ms)
286
+ Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.1ms)
287
+  (0.1ms) SELECT COUNT(*) FROM "test_objs"
288
+ Started GET "/test_objs?variant=small" for 127.0.0.1 at 2013-12-06 09:41:53 -0800
289
+ Processing by TestObjsController#index as HTML
290
+ Parameters: {"variant"=>"small"}
291
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
292
+ Rendered test_objs/_test_obj_small.html.erb (0.4ms)
293
+ Rendered test_objs/_test_obj_small.html.erb (0.3ms)
294
+ Rendered test_objs/_test_obj_small.html.erb (0.2ms)
295
+ Rendered test_objs/_test_obj_small.html.erb (0.0ms)
296
+ Rendered test_objs/_test_obj_small.html.erb (0.0ms)
297
+ Rendered test_objs/index.html.erb within layouts/application (2.9ms)
298
+ Completed 200 OK in 3ms (Views: 3.1ms | ActiveRecord: 0.1ms)
299
+  (0.0ms) SELECT COUNT(*) FROM "test_objs"
300
+  (0.1ms) rollback transaction
301
+  (0.0ms) begin transaction
302
+ ----------------------------------------------------
303
+ TestObjsControllerTest: test_renders_without_variant
304
+ ----------------------------------------------------
305
+ Started GET "/test_objs" for 127.0.0.1 at 2013-12-06 09:41:53 -0800
306
+ Processing by TestObjsController#index as HTML
307
+ TestObj Load (0.1ms) SELECT "test_objs".* FROM "test_objs"
308
+ Rendered test_objs/_test_obj.html.erb (0.3ms)
309
+ Rendered test_objs/_test_obj.html.erb (0.2ms)
310
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
311
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
312
+ Rendered test_objs/_test_obj.html.erb (0.0ms)
313
+ Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms)
314
+  (0.0ms) SELECT COUNT(*) FROM "test_objs"
315
+  (0.0ms) rollback transaction
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,14 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
+
3
+ # This model initially had no columns defined. If you add columns to the
4
+ # model remove the '{}' from the fixture names and add the columns immediately
5
+ # below each fixture, per the syntax in the comments below
6
+ #
7
+ one:
8
+ name: "Test1"
9
+ desc: "test1 description"
10
+ # column: value
11
+ #
12
+ two:
13
+ name: "Test2"
14
+ desc: "test2 description"
@@ -0,0 +1,20 @@
1
+ require 'test_helper'
2
+
3
+ class TestObjsControllerTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ #instead of loading individual partials, attempt to render the entire collection with and without variants
7
+ test "renders without variant" do
8
+ get test_objs_path
9
+ assert_response :success
10
+ assert_select ".default_template", :count=> expected_render_count
11
+ end
12
+
13
+ test "renders with variant" do
14
+ test_variants.each do |name|
15
+ get test_objs_path(:variant => name)
16
+ assert_response :success
17
+ assert_select ".#{name}_template", :count=> expected_render_count
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,26 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
13
+
14
+ # Load fixtures from the engine
15
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
16
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
17
+ end
18
+
19
+ def test_variants
20
+ [:medium, :small]
21
+ end
22
+
23
+ #How many time we should expect to see the item rendered in index.
24
+ def expected_render_count
25
+ TestObj.count * 3
26
+ end