polymorphic_render 0.0.1
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +61 -0
- data/Rakefile +34 -0
- data/app/helpers/polymorphic_render/application_helper.rb +15 -0
- data/lib/polymorphic_render/engine.rb +4 -0
- data/lib/polymorphic_render/version.rb +3 -0
- data/lib/polymorphic_render.rb +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/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/_post.html.erb +1 -0
- data/test/dummy/app/views/posts/_post_admin.html.erb +1 -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 +56 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20140303085238_create_posts.rb +9 -0
- data/test/dummy/db/schema.rb +22 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +14 -0
- data/test/dummy/log/test.log +203 -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/posts.yml +7 -0
- data/test/dummy/test/models/post_test.rb +7 -0
- data/test/helpers/application_helper_test.rb +26 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/polymorphic_render_test.rb +7 -0
- data/test/test_helper.rb +15 -0
- metadata +170 -0
@@ -0,0 +1,22 @@
|
|
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: 20140303085238) do
|
15
|
+
|
16
|
+
create_table "posts", force: true do |t|
|
17
|
+
t.string "title"
|
18
|
+
t.datetime "created_at"
|
19
|
+
t.datetime "updated_at"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
[1m[36m (1.4ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
|
+
[1m[35m (1.6ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
3
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.3ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
4
|
+
Migrating to CreatePosts (20140303085238)
|
5
|
+
[1m[35m (0.1ms)[0m begin transaction
|
6
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
7
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140303085238"]]
|
8
|
+
[1m[36m (1.1ms)[0m [1mcommit transaction[0m
|
9
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
10
|
+
[1m[36m (1.2ms)[0m [1mCREATE TABLE "posts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
11
|
+
[1m[35m (1.2ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
12
|
+
[1m[36m (1.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
13
|
+
[1m[35m (0.2ms)[0m SELECT version FROM "schema_migrations"
|
14
|
+
[1m[36m (1.0ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20140303085238')[0m
|
@@ -0,0 +1,203 @@
|
|
1
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
2
|
+
---------------------------------
|
3
|
+
PolymorphicRenderTest: test_truth
|
4
|
+
---------------------------------
|
5
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
6
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
7
|
+
---------------------------------
|
8
|
+
PolymorphicRenderTest: test_truth
|
9
|
+
---------------------------------
|
10
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
11
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
12
|
+
---------------------------------------------------------------
|
13
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
14
|
+
---------------------------------------------------------------
|
15
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
16
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17
|
+
---------------------------------
|
18
|
+
PolymorphicRenderTest: test_truth
|
19
|
+
---------------------------------
|
20
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
21
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
22
|
+
---------------------------------------------------------------
|
23
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
24
|
+
---------------------------------------------------------------
|
25
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
26
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
+
---------------------------------
|
28
|
+
PolymorphicRenderTest: test_truth
|
29
|
+
---------------------------------
|
30
|
+
[1m[35m (0.1ms)[0m rollback transaction
|
31
|
+
[1m[36m (0.6ms)[0m [1mbegin transaction[0m
|
32
|
+
---------------------------------------------------------------
|
33
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
34
|
+
---------------------------------------------------------------
|
35
|
+
[1m[35m (0.9ms)[0m SAVEPOINT active_record_1
|
36
|
+
[1m[36mSQL (7.6ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:02:49 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:02:49 UTC +00:00]]
|
37
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
38
|
+
[1m[36m (0.8ms)[0m [1mrollback transaction[0m
|
39
|
+
[1m[35m (0.1ms)[0m begin transaction
|
40
|
+
---------------------------------
|
41
|
+
PolymorphicRenderTest: test_truth
|
42
|
+
---------------------------------
|
43
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
44
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
45
|
+
---------------------------------------------------------------
|
46
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
47
|
+
---------------------------------------------------------------
|
48
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
49
|
+
[1m[36mSQL (2.6ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:07:45 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:07:45 UTC +00:00]]
|
50
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
51
|
+
Rendered posts/_post.html.erb (2.8ms)
|
52
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
53
|
+
[1m[35m (0.2ms)[0m begin transaction
|
54
|
+
---------------------------------
|
55
|
+
PolymorphicRenderTest: test_truth
|
56
|
+
---------------------------------
|
57
|
+
[1m[36m (1.1ms)[0m [1mrollback transaction[0m
|
58
|
+
[1m[36m (0.6ms)[0m [1mbegin transaction[0m
|
59
|
+
---------------------------------------------------------------
|
60
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
61
|
+
---------------------------------------------------------------
|
62
|
+
[1m[35m (0.2ms)[0m SAVEPOINT active_record_1
|
63
|
+
[1m[36mSQL (2.9ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:08:17 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:08:17 UTC +00:00]]
|
64
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
65
|
+
Rendered posts/_post.html.erb (1.2ms)
|
66
|
+
[1m[36m (1.5ms)[0m [1mrollback transaction[0m
|
67
|
+
[1m[35m (0.1ms)[0m begin transaction
|
68
|
+
---------------------------------
|
69
|
+
PolymorphicRenderTest: test_truth
|
70
|
+
---------------------------------
|
71
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
72
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
73
|
+
---------------------------------------------------------------
|
74
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
75
|
+
---------------------------------------------------------------
|
76
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
77
|
+
[1m[36mSQL (2.6ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:08:59 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:08:59 UTC +00:00]]
|
78
|
+
[1m[35m (0.2ms)[0m RELEASE SAVEPOINT active_record_1
|
79
|
+
Rendered posts/_post.html.erb (1.2ms)
|
80
|
+
[1m[36m (2.5ms)[0m [1mrollback transaction[0m
|
81
|
+
[1m[35m (0.1ms)[0m begin transaction
|
82
|
+
---------------------------------
|
83
|
+
PolymorphicRenderTest: test_truth
|
84
|
+
---------------------------------
|
85
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
86
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
87
|
+
--------------------------------------------------------------------------
|
88
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
89
|
+
--------------------------------------------------------------------------
|
90
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
91
|
+
[1m[36mSQL (3.0ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
92
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
93
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
94
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
95
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
96
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts"
|
97
|
+
Rendered posts/_post.html.erb (0.9ms)
|
98
|
+
Rendered posts/_post.html.erb (0.1ms)
|
99
|
+
[1m[36m (2.6ms)[0m [1mrollback transaction[0m
|
100
|
+
[1m[35m (0.1ms)[0m begin transaction
|
101
|
+
---------------------------------------------------------------
|
102
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
103
|
+
---------------------------------------------------------------
|
104
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
105
|
+
[1m[35mSQL (0.7ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
106
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
107
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
108
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:10:32 UTC +00:00]]
|
109
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
110
|
+
[1m[36m (0.4ms)[0m [1mrollback transaction[0m
|
111
|
+
[1m[35m (0.1ms)[0m begin transaction
|
112
|
+
---------------------------------
|
113
|
+
PolymorphicRenderTest: test_truth
|
114
|
+
---------------------------------
|
115
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
116
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
117
|
+
--------------------------------------------------------------------------
|
118
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
119
|
+
--------------------------------------------------------------------------
|
120
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
121
|
+
[1m[36mSQL (2.7ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00]]
|
122
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
123
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
124
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00]]
|
125
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
126
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts"
|
127
|
+
Rendered posts/_post.html.erb (0.8ms)
|
128
|
+
Rendered posts/_post.html.erb (0.1ms)
|
129
|
+
[1m[36m (2.7ms)[0m [1mrollback transaction[0m
|
130
|
+
[1m[35m (0.2ms)[0m begin transaction
|
131
|
+
---------------------------------------------------------------
|
132
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
133
|
+
---------------------------------------------------------------
|
134
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
135
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00]]
|
136
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
137
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
138
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:10:58 UTC +00:00]]
|
139
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
140
|
+
Rendered posts/_post.html.erb (0.1ms)
|
141
|
+
[1m[36m (0.6ms)[0m [1mrollback transaction[0m
|
142
|
+
[1m[35m (0.2ms)[0m begin transaction
|
143
|
+
---------------------------------
|
144
|
+
PolymorphicRenderTest: test_truth
|
145
|
+
---------------------------------
|
146
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
147
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
148
|
+
------------------------------------------------------------------------------
|
149
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_collection_rendering
|
150
|
+
------------------------------------------------------------------------------
|
151
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
152
|
+
[1m[36mSQL (2.7ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
153
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
154
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
155
|
+
[1m[35mSQL (0.4ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
156
|
+
[1m[36m (0.0ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
157
|
+
[1m[35mPost Load (0.1ms)[0m SELECT "posts".* FROM "posts"
|
158
|
+
Rendered posts/_post_admin.html.erb (0.7ms)
|
159
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
160
|
+
[1m[36m (1.6ms)[0m [1mrollback transaction[0m
|
161
|
+
[1m[35m (0.1ms)[0m begin transaction
|
162
|
+
-------------------------------------------------------------------
|
163
|
+
PolymorphicRender::ApplicationHelperTest: test_namespaced_rendering
|
164
|
+
-------------------------------------------------------------------
|
165
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
166
|
+
[1m[35mSQL (0.5ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
167
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
168
|
+
[1m[35m (0.0ms)[0m SAVEPOINT active_record_1
|
169
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
170
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
171
|
+
Rendered posts/_post_admin.html.erb (0.1ms)
|
172
|
+
[1m[36m (0.5ms)[0m [1mrollback transaction[0m
|
173
|
+
[1m[35m (0.1ms)[0m begin transaction
|
174
|
+
--------------------------------------------------------------------------
|
175
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_collection_rendering
|
176
|
+
--------------------------------------------------------------------------
|
177
|
+
[1m[36m (0.1ms)[0m [1mSAVEPOINT active_record_1[0m
|
178
|
+
[1m[35mSQL (0.6ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
179
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
180
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
181
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
182
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
183
|
+
[1m[36mPost Load (0.1ms)[0m [1mSELECT "posts".* FROM "posts"[0m
|
184
|
+
Rendered posts/_post.html.erb (0.9ms)
|
185
|
+
Rendered posts/_post.html.erb (0.2ms)
|
186
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
187
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
188
|
+
---------------------------------------------------------------
|
189
|
+
PolymorphicRender::ApplicationHelperTest: test_simple_rendering
|
190
|
+
---------------------------------------------------------------
|
191
|
+
[1m[35m (0.1ms)[0m SAVEPOINT active_record_1
|
192
|
+
[1m[36mSQL (0.5ms)[0m [1mINSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?)[0m [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "My First Post"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
193
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
194
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
195
|
+
[1m[35mSQL (0.3ms)[0m INSERT INTO "posts" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00], ["title", "I am Blogger!"], ["updated_at", Mon, 03 Mar 2014 09:13:28 UTC +00:00]]
|
196
|
+
[1m[36m (0.1ms)[0m [1mRELEASE SAVEPOINT active_record_1[0m
|
197
|
+
Rendered posts/_post.html.erb (0.1ms)
|
198
|
+
[1m[35m (0.6ms)[0m rollback transaction
|
199
|
+
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
200
|
+
---------------------------------
|
201
|
+
PolymorphicRenderTest: test_truth
|
202
|
+
---------------------------------
|
203
|
+
[1m[35m (0.1ms)[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,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class PolymorphicRender::ApplicationHelperTest < ActionView::TestCase
|
4
|
+
include PolymorphicRender::ApplicationHelper
|
5
|
+
|
6
|
+
setup do
|
7
|
+
@post1 = Post.create title: 'My First Post'
|
8
|
+
@post2 = Post.create title: 'I am Blogger!'
|
9
|
+
end
|
10
|
+
|
11
|
+
test 'simple rendering' do
|
12
|
+
assert_equal "Title: My First Post\n", polymorphic_render(@post1)
|
13
|
+
end
|
14
|
+
|
15
|
+
test 'simple collection rendering' do
|
16
|
+
assert_equal "Title: My First Post\nTitle: I am Blogger!\n", polymorphic_render(Post.all)
|
17
|
+
end
|
18
|
+
|
19
|
+
test 'namespaced rendering' do
|
20
|
+
assert_equal "Edit: My First Post\n", polymorphic_render(@post1, :admin)
|
21
|
+
end
|
22
|
+
|
23
|
+
test 'namespaced collection rendering' do
|
24
|
+
assert_equal "Edit: My First Post\nEdit: I am Blogger!\n", polymorphic_render(Post.all, :admin)
|
25
|
+
end
|
26
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
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
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|