render_variant 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/render_variant/version.rb +1 -1
- data/test/dummy/app/controllers/variant_objects_controller.rb +10 -0
- data/test/dummy/app/models/variant_object.rb +2 -0
- data/test/dummy/app/views/variant_objects/_variant_object.html.erb +1 -0
- data/test/dummy/app/views/variant_objects/_variant_object_medium.html.erb +1 -0
- data/test/dummy/app/views/variant_objects/_variant_object_small.html.erb +1 -0
- data/test/dummy/app/views/variant_objects/index.html.erb +21 -0
- data/test/dummy/config/routes.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20131206162427_create_variant_objects.rb +9 -0
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +25 -0
- data/test/dummy/log/test.log +206 -0
- data/test/dummy/test/fixtures/{test_objs.yml → variant_objects.yml} +1 -1
- data/test/integration/{test_objs_controller_test.rb → variant_object_controller_test.rb} +4 -4
- data/test/test_helper.rb +2 -2
- metadata +21 -21
- data/test/dummy/app/controllers/test_objs_controller.rb +0 -10
- data/test/dummy/app/models/test_obj.rb +0 -2
- data/test/dummy/app/views/test_objs/_test_obj.html.erb +0 -1
- data/test/dummy/app/views/test_objs/_test_obj_medium.html.erb +0 -1
- data/test/dummy/app/views/test_objs/_test_obj_small.html.erb +0 -1
- data/test/dummy/app/views/test_objs/index.html.erb +0 -21
- data/test/dummy/db/migrate/20131206162427_create_test_objs.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57748c63e6408eff7bc9eeb1ce2a4c9078038811
|
4
|
+
data.tar.gz: e3a75c5096213ba72386d7a2d79b782552cf1a06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd4611e0eb9570665dce4926bffef6484bfb6926b65f8a81adb4e3ff1b594b9c945241a746839aead21d4a2626dd74a2b0af030a6d195014a5d0cfb40691710c
|
7
|
+
data.tar.gz: b5c3987274bef336ea52c34e2997d3134766442d958f12c5773e8c2006578b7ffa71bf4ea2a6a55ea1fd26d1d4331dc15b383a0d5c733544c37ccff1a4b25531
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1 class="default_template"><%= variant_object.name %></h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h2 class="medium_template"><%= variant_object.name %></h2>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h3 class="small_template"><%= variant_object.name %></h3>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div id="test_disp_container">
|
2
|
+
<% if @variant %>
|
3
|
+
|
4
|
+
<%= render @variant_objects, :variant => @variant %>
|
5
|
+
<hr/>
|
6
|
+
<% @variant_objects.each do |variant_object| %>
|
7
|
+
<%= render :partial=> variant_object, :variant => @variant %>
|
8
|
+
<br/>
|
9
|
+
<%= render variant_object, :variant => @variant %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<% else %>
|
13
|
+
<%= render @variant_objects %>
|
14
|
+
<hr/>
|
15
|
+
<% @variant_objects.each do |variant_object| %>
|
16
|
+
<%= render :partial=> variant_object %>
|
17
|
+
<br/>
|
18
|
+
<%= render variant_object %>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
data/test/dummy/config/routes.rb
CHANGED
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|
@@ -13,3 +13,28 @@ Migrating to CreateTestObjs (20131206162427)
|
|
13
13
|
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
14
14
|
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131206162427')[0m
|
15
15
|
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
16
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
17
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
18
|
+
[1m[36m (1.7ms)[0m [1mCREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
19
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
20
|
+
[1m[36m (0.6ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
21
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
22
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131206162427')[0m
|
23
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
24
|
+
[1m[36m (1.8ms)[0m [1mCREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
25
|
+
[1m[35m (0.9ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
26
|
+
[1m[36m (0.9ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
27
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
28
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131206162427')[0m
|
29
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
30
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
31
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
32
|
+
[1m[36m (1.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
33
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
34
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
35
|
+
Migrating to CreateVariantObjects (20131206162427)
|
36
|
+
[1m[35m (0.0ms)[0m begin transaction
|
37
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "variant_objects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
38
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
|
39
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
40
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
data/test/dummy/log/test.log
CHANGED
@@ -313,3 +313,209 @@ Processing by TestObjsController#index as HTML
|
|
313
313
|
Completed 200 OK in 3ms (Views: 2.3ms | ActiveRecord: 0.1ms)
|
314
314
|
[1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
315
315
|
[1m[35m (0.0ms)[0m rollback transaction
|
316
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
317
|
+
[1m[35m (0.1ms)[0m begin transaction
|
318
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
319
|
+
[1m[35m (0.0ms)[0m begin transaction
|
320
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
321
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
322
|
+
[1m[35m (0.0ms)[0m begin transaction
|
323
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
324
|
+
[1m[35m (0.0ms)[0m begin transaction
|
325
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
326
|
+
[1m[36m (1.9ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
327
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
328
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
329
|
+
Migrating to CreateVariantObjects (20131206162427)
|
330
|
+
[1m[35m (0.1ms)[0m begin transaction
|
331
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "variant_objects" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "desc" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
332
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
|
333
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
334
|
+
[1m[35m (0.0ms)[0m begin transaction
|
335
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "variant_objects"[0m
|
336
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 20:57:50', '2013-12-09 20:57:50', 980190962)
|
337
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 20:57:50', '2013-12-09 20:57:50', 298486374)[0m
|
338
|
+
[1m[35m (0.7ms)[0m commit transaction
|
339
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
340
|
+
------------------------------------------------------
|
341
|
+
VariantObjectControllerTest: test_renders_with_variant
|
342
|
+
------------------------------------------------------
|
343
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
344
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
345
|
+
---------------------------------------------------------
|
346
|
+
VariantObjectControllerTest: test_renders_without_variant
|
347
|
+
---------------------------------------------------------
|
348
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
349
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
350
|
+
[1m[35m (0.0ms)[0m begin transaction
|
351
|
+
[1m[36mFixture Delete (0.3ms)[0m [1mDELETE FROM "variant_objects"[0m
|
352
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 20:59:01', '2013-12-09 20:59:01', 980190962)
|
353
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 20:59:01', '2013-12-09 20:59:01', 298486374)[0m
|
354
|
+
[1m[35m (1.1ms)[0m commit transaction
|
355
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
356
|
+
------------------------------------------------------
|
357
|
+
VariantObjectControllerTest: test_renders_with_variant
|
358
|
+
------------------------------------------------------
|
359
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 12:59:01 -0800
|
360
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
361
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
362
|
+
---------------------------------------------------------
|
363
|
+
VariantObjectControllerTest: test_renders_without_variant
|
364
|
+
---------------------------------------------------------
|
365
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
366
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
367
|
+
[1m[35m (0.1ms)[0m begin transaction
|
368
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "variant_objects"[0m
|
369
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 20:59:17', '2013-12-09 20:59:17', 980190962)
|
370
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 20:59:17', '2013-12-09 20:59:17', 298486374)[0m
|
371
|
+
[1m[35m (0.5ms)[0m commit transaction
|
372
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
373
|
+
------------------------------------------------------
|
374
|
+
VariantObjectControllerTest: test_renders_with_variant
|
375
|
+
------------------------------------------------------
|
376
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 12:59:17 -0800
|
377
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
378
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
379
|
+
---------------------------------------------------------
|
380
|
+
VariantObjectControllerTest: test_renders_without_variant
|
381
|
+
---------------------------------------------------------
|
382
|
+
Started GET "/variant_objects" for 127.0.0.1 at 2013-12-09 12:59:17 -0800
|
383
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
384
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
385
|
+
[1m[35m (0.1ms)[0m begin transaction
|
386
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "variant_objects"[0m
|
387
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 20:59:48', '2013-12-09 20:59:48', 980190962)
|
388
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 20:59:48', '2013-12-09 20:59:48', 298486374)[0m
|
389
|
+
[1m[35m (1.0ms)[0m commit transaction
|
390
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
391
|
+
------------------------------------------------------
|
392
|
+
VariantObjectControllerTest: test_renders_with_variant
|
393
|
+
------------------------------------------------------
|
394
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 12:59:48 -0800
|
395
|
+
Processing by VariantObjectsController#index as HTML
|
396
|
+
Parameters: {"variant"=>"medium"}
|
397
|
+
[1m[35mVariantObject Load (0.1ms)[0m SELECT "variant_objects".* FROM "variant_objects"
|
398
|
+
Rendered variant_objects/_variant_object_medium.html.erb (7.0ms)
|
399
|
+
Rendered variant_objects/index.html.erb within layouts/application (11.6ms)
|
400
|
+
Completed 500 Internal Server Error in 14ms
|
401
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
402
|
+
[1m[35m (0.0ms)[0m begin transaction
|
403
|
+
---------------------------------------------------------
|
404
|
+
VariantObjectControllerTest: test_renders_without_variant
|
405
|
+
---------------------------------------------------------
|
406
|
+
Started GET "/variant_objects" for 127.0.0.1 at 2013-12-09 12:59:48 -0800
|
407
|
+
Processing by VariantObjectsController#index as HTML
|
408
|
+
[1m[36mVariantObject Load (0.1ms)[0m [1mSELECT "variant_objects".* FROM "variant_objects"[0m
|
409
|
+
Rendered variant_objects/_variant_object.html.erb (26.5ms)
|
410
|
+
Completed 500 Internal Server Error in 28ms
|
411
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
412
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
413
|
+
[1m[35m (0.1ms)[0m begin transaction
|
414
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "variant_objects"[0m
|
415
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 21:00:40', '2013-12-09 21:00:40', 980190962)
|
416
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 21:00:40', '2013-12-09 21:00:40', 298486374)[0m
|
417
|
+
[1m[35m (1.4ms)[0m commit transaction
|
418
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
419
|
+
------------------------------------------------------
|
420
|
+
VariantObjectControllerTest: test_renders_with_variant
|
421
|
+
------------------------------------------------------
|
422
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 13:00:40 -0800
|
423
|
+
Processing by VariantObjectsController#index as HTML
|
424
|
+
Parameters: {"variant"=>"medium"}
|
425
|
+
Rendered variant_objects/index.html.erb within layouts/application (1.9ms)
|
426
|
+
Completed 500 Internal Server Error in 4ms
|
427
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
428
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
429
|
+
---------------------------------------------------------
|
430
|
+
VariantObjectControllerTest: test_renders_without_variant
|
431
|
+
---------------------------------------------------------
|
432
|
+
Started GET "/variant_objects" for 127.0.0.1 at 2013-12-09 13:00:40 -0800
|
433
|
+
Processing by VariantObjectsController#index as HTML
|
434
|
+
Completed 500 Internal Server Error in 1ms
|
435
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
436
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
437
|
+
[1m[35m (0.0ms)[0m begin transaction
|
438
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "variant_objects"[0m
|
439
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 21:01:23', '2013-12-09 21:01:23', 980190962)
|
440
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 21:01:23', '2013-12-09 21:01:23', 298486374)[0m
|
441
|
+
[1m[35m (1.1ms)[0m commit transaction
|
442
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
443
|
+
------------------------------------------------------
|
444
|
+
VariantObjectControllerTest: test_renders_with_variant
|
445
|
+
------------------------------------------------------
|
446
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 13:01:23 -0800
|
447
|
+
Processing by VariantObjectsController#index as HTML
|
448
|
+
Parameters: {"variant"=>"medium"}
|
449
|
+
[1m[35mVariantObject Load (0.2ms)[0m SELECT "variant_objects".* FROM "variant_objects"
|
450
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.4ms)
|
451
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.2ms)
|
452
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.2ms)
|
453
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.1ms)
|
454
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.0ms)
|
455
|
+
Rendered variant_objects/index.html.erb within layouts/application (6.9ms)
|
456
|
+
Completed 200 OK in 10ms (Views: 9.4ms | ActiveRecord: 0.2ms)
|
457
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
458
|
+
[1m[35m (0.0ms)[0m begin transaction
|
459
|
+
---------------------------------------------------------
|
460
|
+
VariantObjectControllerTest: test_renders_without_variant
|
461
|
+
---------------------------------------------------------
|
462
|
+
Started GET "/variant_objects" for 127.0.0.1 at 2013-12-09 13:01:23 -0800
|
463
|
+
Processing by VariantObjectsController#index as HTML
|
464
|
+
[1m[36mVariantObject Load (0.1ms)[0m [1mSELECT "variant_objects".* FROM "variant_objects"[0m
|
465
|
+
Rendered variant_objects/_variant_object.html.erb (0.4ms)
|
466
|
+
Rendered variant_objects/_variant_object.html.erb (0.3ms)
|
467
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
468
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
469
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
470
|
+
Completed 200 OK in 3ms (Views: 2.4ms | ActiveRecord: 0.1ms)
|
471
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
472
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
473
|
+
[1m[35m (0.1ms)[0m begin transaction
|
474
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "variant_objects"[0m
|
475
|
+
[1m[35mFixture Insert (0.1ms)[0m INSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test1', 'test1 description', '2013-12-09 21:01:43', '2013-12-09 21:01:43', 980190962)
|
476
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT INTO "variant_objects" ("name", "desc", "created_at", "updated_at", "id") VALUES ('Test2', 'test2 description', '2013-12-09 21:01:43', '2013-12-09 21:01:43', 298486374)[0m
|
477
|
+
[1m[35m (1.0ms)[0m commit transaction
|
478
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
479
|
+
------------------------------------------------------
|
480
|
+
VariantObjectControllerTest: test_renders_with_variant
|
481
|
+
------------------------------------------------------
|
482
|
+
Started GET "/variant_objects?variant=medium" for 127.0.0.1 at 2013-12-09 13:01:43 -0800
|
483
|
+
Processing by VariantObjectsController#index as HTML
|
484
|
+
Parameters: {"variant"=>"medium"}
|
485
|
+
[1m[35mVariantObject Load (0.1ms)[0m SELECT "variant_objects".* FROM "variant_objects"
|
486
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.4ms)
|
487
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.2ms)
|
488
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.2ms)
|
489
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.0ms)
|
490
|
+
Rendered variant_objects/_variant_object_medium.html.erb (0.0ms)
|
491
|
+
Rendered variant_objects/index.html.erb within layouts/application (6.6ms)
|
492
|
+
Completed 200 OK in 9ms (Views: 9.0ms | ActiveRecord: 0.1ms)
|
493
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "variant_objects"[0m
|
494
|
+
Started GET "/variant_objects?variant=small" for 127.0.0.1 at 2013-12-09 13:01:43 -0800
|
495
|
+
Processing by VariantObjectsController#index as HTML
|
496
|
+
Parameters: {"variant"=>"small"}
|
497
|
+
[1m[35mVariantObject Load (0.1ms)[0m SELECT "variant_objects".* FROM "variant_objects"
|
498
|
+
Rendered variant_objects/_variant_object_small.html.erb (0.3ms)
|
499
|
+
Rendered variant_objects/_variant_object_small.html.erb (0.2ms)
|
500
|
+
Rendered variant_objects/_variant_object_small.html.erb (0.3ms)
|
501
|
+
Rendered variant_objects/_variant_object_small.html.erb (0.0ms)
|
502
|
+
Rendered variant_objects/_variant_object_small.html.erb (0.0ms)
|
503
|
+
Rendered variant_objects/index.html.erb within layouts/application (3.2ms)
|
504
|
+
Completed 200 OK in 4ms (Views: 3.5ms | ActiveRecord: 0.1ms)
|
505
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "variant_objects"[0m
|
506
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
507
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
508
|
+
---------------------------------------------------------
|
509
|
+
VariantObjectControllerTest: test_renders_without_variant
|
510
|
+
---------------------------------------------------------
|
511
|
+
Started GET "/variant_objects" for 127.0.0.1 at 2013-12-09 13:01:43 -0800
|
512
|
+
Processing by VariantObjectsController#index as HTML
|
513
|
+
[1m[35mVariantObject Load (0.1ms)[0m SELECT "variant_objects".* FROM "variant_objects"
|
514
|
+
Rendered variant_objects/_variant_object.html.erb (0.5ms)
|
515
|
+
Rendered variant_objects/_variant_object.html.erb (0.3ms)
|
516
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
517
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
518
|
+
Rendered variant_objects/_variant_object.html.erb (0.0ms)
|
519
|
+
Completed 200 OK in 3ms (Views: 3.0ms | ActiveRecord: 0.1ms)
|
520
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "variant_objects"[0m
|
521
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -1,18 +1,18 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class VariantObjectControllerTest < ActionDispatch::IntegrationTest
|
4
4
|
fixtures :all
|
5
5
|
|
6
6
|
#instead of loading individual partials, attempt to render the entire collection with and without variants
|
7
7
|
test "renders without variant" do
|
8
|
-
get
|
8
|
+
get variant_objects_path
|
9
9
|
assert_response :success
|
10
10
|
assert_select ".default_template", :count=> expected_render_count
|
11
11
|
end
|
12
12
|
|
13
13
|
test "renders with variant" do
|
14
|
-
|
15
|
-
get
|
14
|
+
variants_for_test.each do |name|
|
15
|
+
get variant_objects_path(:variant => name)
|
16
16
|
assert_response :success
|
17
17
|
assert_select ".#{name}_template", :count=> expected_render_count
|
18
18
|
end
|
data/test/test_helper.rb
CHANGED
@@ -16,11 +16,11 @@ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
|
16
16
|
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def variants_for_test
|
20
20
|
[:medium, :small]
|
21
21
|
end
|
22
22
|
|
23
23
|
#How many time we should expect to see the item rendered in index.
|
24
24
|
def expected_render_count
|
25
|
-
|
25
|
+
VariantObject.count * 3
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render_variant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -56,14 +56,14 @@ files:
|
|
56
56
|
- test/dummy/app/assets/javascripts/application.js
|
57
57
|
- test/dummy/app/assets/stylesheets/application.css
|
58
58
|
- test/dummy/app/controllers/application_controller.rb
|
59
|
-
- test/dummy/app/controllers/
|
59
|
+
- test/dummy/app/controllers/variant_objects_controller.rb
|
60
60
|
- test/dummy/app/helpers/application_helper.rb
|
61
|
-
- test/dummy/app/models/
|
61
|
+
- test/dummy/app/models/variant_object.rb
|
62
62
|
- test/dummy/app/views/layouts/application.html.erb
|
63
|
-
- test/dummy/app/views/
|
64
|
-
- test/dummy/app/views/
|
65
|
-
- test/dummy/app/views/
|
66
|
-
- test/dummy/app/views/
|
63
|
+
- test/dummy/app/views/variant_objects/_variant_object.html.erb
|
64
|
+
- test/dummy/app/views/variant_objects/_variant_object_medium.html.erb
|
65
|
+
- test/dummy/app/views/variant_objects/_variant_object_small.html.erb
|
66
|
+
- test/dummy/app/views/variant_objects/index.html.erb
|
67
67
|
- test/dummy/bin/bundle
|
68
68
|
- test/dummy/bin/rails
|
69
69
|
- test/dummy/bin/rake
|
@@ -85,7 +85,7 @@ files:
|
|
85
85
|
- test/dummy/config/routes.rb
|
86
86
|
- test/dummy/config.ru
|
87
87
|
- test/dummy/db/development.sqlite3
|
88
|
-
- test/dummy/db/migrate/
|
88
|
+
- test/dummy/db/migrate/20131206162427_create_variant_objects.rb
|
89
89
|
- test/dummy/db/schema.rb
|
90
90
|
- test/dummy/db/test.sqlite3
|
91
91
|
- test/dummy/log/development.log
|
@@ -96,10 +96,10 @@ files:
|
|
96
96
|
- test/dummy/public/favicon.ico
|
97
97
|
- test/dummy/Rakefile
|
98
98
|
- test/dummy/README.rdoc
|
99
|
-
- test/dummy/test/fixtures/
|
100
|
-
- test/integration/
|
99
|
+
- test/dummy/test/fixtures/variant_objects.yml
|
100
|
+
- test/integration/variant_object_controller_test.rb
|
101
101
|
- test/test_helper.rb
|
102
|
-
homepage: http://
|
102
|
+
homepage: http://github.com/alexanderross/render_variant
|
103
103
|
licenses: []
|
104
104
|
metadata: {}
|
105
105
|
post_install_message:
|
@@ -126,14 +126,14 @@ test_files:
|
|
126
126
|
- test/dummy/app/assets/javascripts/application.js
|
127
127
|
- test/dummy/app/assets/stylesheets/application.css
|
128
128
|
- test/dummy/app/controllers/application_controller.rb
|
129
|
-
- test/dummy/app/controllers/
|
129
|
+
- test/dummy/app/controllers/variant_objects_controller.rb
|
130
130
|
- test/dummy/app/helpers/application_helper.rb
|
131
|
-
- test/dummy/app/models/
|
131
|
+
- test/dummy/app/models/variant_object.rb
|
132
132
|
- test/dummy/app/views/layouts/application.html.erb
|
133
|
-
- test/dummy/app/views/
|
134
|
-
- test/dummy/app/views/
|
135
|
-
- test/dummy/app/views/
|
136
|
-
- test/dummy/app/views/
|
133
|
+
- test/dummy/app/views/variant_objects/_variant_object.html.erb
|
134
|
+
- test/dummy/app/views/variant_objects/_variant_object_medium.html.erb
|
135
|
+
- test/dummy/app/views/variant_objects/_variant_object_small.html.erb
|
136
|
+
- test/dummy/app/views/variant_objects/index.html.erb
|
137
137
|
- test/dummy/bin/bundle
|
138
138
|
- test/dummy/bin/rails
|
139
139
|
- test/dummy/bin/rake
|
@@ -155,7 +155,7 @@ test_files:
|
|
155
155
|
- test/dummy/config/routes.rb
|
156
156
|
- test/dummy/config.ru
|
157
157
|
- test/dummy/db/development.sqlite3
|
158
|
-
- test/dummy/db/migrate/
|
158
|
+
- test/dummy/db/migrate/20131206162427_create_variant_objects.rb
|
159
159
|
- test/dummy/db/schema.rb
|
160
160
|
- test/dummy/db/test.sqlite3
|
161
161
|
- test/dummy/log/development.log
|
@@ -166,6 +166,6 @@ test_files:
|
|
166
166
|
- test/dummy/public/favicon.ico
|
167
167
|
- test/dummy/Rakefile
|
168
168
|
- test/dummy/README.rdoc
|
169
|
-
- test/dummy/test/fixtures/
|
170
|
-
- test/integration/
|
169
|
+
- test/dummy/test/fixtures/variant_objects.yml
|
170
|
+
- test/integration/variant_object_controller_test.rb
|
171
171
|
- test/test_helper.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
<h1 class="default_template"><%= test_obj.name %></h1>
|
@@ -1 +0,0 @@
|
|
1
|
-
<h2 class="medium_template"><%= test_obj.name %></h2>
|
@@ -1 +0,0 @@
|
|
1
|
-
<h3 class="small_template"><%= test_obj.name %></h3>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<div id="test_disp_container">
|
2
|
-
<% if @variant %>
|
3
|
-
|
4
|
-
<%= render @test_objs, :variant => @variant %>
|
5
|
-
<hr/>
|
6
|
-
<% @test_objs.each do |test_obj| %>
|
7
|
-
<%= render :partial=> test_obj, :variant => @variant %>
|
8
|
-
<br/>
|
9
|
-
<%= render test_obj, :variant => @variant %>
|
10
|
-
<% end %>
|
11
|
-
|
12
|
-
<% else %>
|
13
|
-
<%= render @test_objs %>
|
14
|
-
<hr/>
|
15
|
-
<% @test_objs.each do |test_obj| %>
|
16
|
-
<%= render :partial=> test_obj %>
|
17
|
-
<br/>
|
18
|
-
<%= render test_obj %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
21
|
-
</div>
|