render_variant 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +32 -0
- data/lib/render_variant/partial_variant_extension.rb +20 -0
- data/lib/render_variant/railtie.rb +9 -0
- data/lib/render_variant/version.rb +3 -0
- data/lib/render_variant.rb +6 -0
- data/lib/tasks/render_variant_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/test_objs_controller.rb +10 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/test_obj.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +11 -0
- data/test/dummy/app/views/test_objs/_test_obj.html.erb +1 -0
- data/test/dummy/app/views/test_objs/_test_obj_medium.html.erb +1 -0
- data/test/dummy/app/views/test_objs/_test_obj_small.html.erb +1 -0
- data/test/dummy/app/views/test_objs/index.html.erb +21 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +29 -0
- data/test/dummy/config/environments/production.rb +80 -0
- data/test/dummy/config/environments/test.rb +36 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +12 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20131206162427_create_test_objs.rb +9 -0
- data/test/dummy/db/schema.rb +23 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +15 -0
- data/test/dummy/log/test.log +315 -0
- data/test/dummy/public/404.html +58 -0
- data/test/dummy/public/422.html +58 -0
- data/test/dummy/public/500.html +57 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/fixtures/test_objs.yml +14 -0
- data/test/integration/test_objs_controller_test.rb +20 -0
- data/test/test_helper.rb +26 -0
- 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
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
+
Migrating to CreateTestObjs (20131206162427)
|
5
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
7
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
|
8
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
9
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
10
|
+
[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
|
11
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
12
|
+
[1m[36m (0.7ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
13
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
14
|
+
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20131206162427')[0m
|
15
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
@@ -0,0 +1,315 @@
|
|
1
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
2
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
3
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
4
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5
|
+
[1m[36m (0.2ms)[0m [1mbegin transaction[0m
|
6
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
7
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
8
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
9
|
+
[1m[36m (1.8ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
10
|
+
[1m[35m (0.9ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
11
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
12
|
+
Migrating to CreateTestObjs (20131206162427)
|
13
|
+
[1m[35m (0.1ms)[0m begin transaction
|
14
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "test_objs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "description" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
15
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
|
16
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
17
|
+
[1m[35m (0.1ms)[0m begin transaction
|
18
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
19
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
22
|
+
[1m[35m (0.0ms)[0m begin transaction
|
23
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "test_objs"[0m
|
24
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
27
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
28
|
+
[1m[35m (0.1ms)[0m begin transaction
|
29
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
30
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (1.0ms)[0m [1mrollback transaction[0m
|
33
|
+
[1m[35m (0.1ms)[0m begin transaction
|
34
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "test_objs"[0m
|
35
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
38
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
39
|
+
[1m[35m (0.1ms)[0m begin transaction
|
40
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
41
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (1.0ms)[0m [1mrollback transaction[0m
|
44
|
+
[1m[35m (0.1ms)[0m begin transaction
|
45
|
+
[1m[36mFixture Delete (0.1ms)[0m [1mDELETE FROM "test_objs"[0m
|
46
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
49
|
+
[1m[36m (1.6ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
50
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
51
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
52
|
+
Migrating to CreateTestObjs (20131206162427)
|
53
|
+
[1m[35m (0.1ms)[0m begin transaction
|
54
|
+
[1m[36m (0.2ms)[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
|
55
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20131206162427"]]
|
56
|
+
[1m[36m (0.7ms)[0m [1mcommit transaction[0m
|
57
|
+
[1m[35m (0.1ms)[0m begin transaction
|
58
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
59
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.1ms)[0m [1mINSERT 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)[0m
|
61
|
+
[1m[35m (0.8ms)[0m commit transaction
|
62
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
63
|
+
-------------------------------------------------
|
64
|
+
TestObjsControllerTest: test_renders_with_variant
|
65
|
+
-------------------------------------------------
|
66
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
67
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
68
|
+
----------------------------------------------------
|
69
|
+
TestObjsControllerTest: test_renders_without_variant
|
70
|
+
----------------------------------------------------
|
71
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
72
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
73
|
+
[1m[35m (0.0ms)[0m begin transaction
|
74
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
75
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
77
|
+
[1m[35m (1.6ms)[0m commit transaction
|
78
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
88
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
96
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
97
|
+
[1m[35m (0.1ms)[0m begin transaction
|
98
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
99
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
101
|
+
[1m[35m (1.0ms)[0m commit transaction
|
102
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
112
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
113
|
+
----------------------------------------------------
|
114
|
+
TestObjsControllerTest: test_renders_without_variant
|
115
|
+
----------------------------------------------------
|
116
|
+
[1m[35m (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
121
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
122
|
+
[1m[35m (0.1ms)[0m begin transaction
|
123
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
124
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
126
|
+
[1m[35m (1.3ms)[0m commit transaction
|
127
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
137
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
145
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
146
|
+
[1m[35m (0.1ms)[0m begin transaction
|
147
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
148
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
150
|
+
[1m[35m (1.5ms)[0m commit transaction
|
151
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
161
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
169
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
170
|
+
[1m[35m (0.1ms)[0m begin transaction
|
171
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
172
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
174
|
+
[1m[35m (1.3ms)[0m commit transaction
|
175
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
186
|
+
[1m[35m (0.0ms)[0m 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
|
+
[1m[36mTestObj Load (0.1ms)[0m [1mSELECT "test_objs".* FROM "test_objs"[0m
|
193
|
+
Completed 500 Internal Server Error in 2ms
|
194
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
195
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
196
|
+
[1m[35m (0.1ms)[0m begin transaction
|
197
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
198
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
200
|
+
[1m[35m (1.5ms)[0m commit transaction
|
201
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
217
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
218
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
228
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
229
|
+
[1m[35m (0.1ms)[0m begin transaction
|
230
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
231
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
233
|
+
[1m[35m (1.3ms)[0m commit transaction
|
234
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
250
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
251
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
265
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
266
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
267
|
+
[1m[35m (0.1ms)[0m begin transaction
|
268
|
+
[1m[36mFixture Delete (0.2ms)[0m [1mDELETE FROM "test_objs"[0m
|
269
|
+
[1m[35mFixture Insert (0.1ms)[0m 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
|
+
[1m[36mFixture Insert (0.0ms)[0m [1mINSERT 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)[0m
|
271
|
+
[1m[35m (1.4ms)[0m commit transaction
|
272
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.1ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
300
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
301
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
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
|
+
[1m[35mTestObj Load (0.1ms)[0m 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
|
+
[1m[36m (0.0ms)[0m [1mSELECT COUNT(*) FROM "test_objs"[0m
|
315
|
+
[1m[35m (0.0ms)[0m 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
|
data/test/test_helper.rb
ADDED
@@ -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
|