extra_extra 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +30 -0
  4. data/app/controllers/extra_extra/application_controller.rb +4 -0
  5. data/app/controllers/extra_extra/release_notes_controller.rb +20 -0
  6. data/app/views/extra_extra/release_notes/index.html.erb +6 -0
  7. data/config/routes.rb +3 -0
  8. data/lib/extra_extra/engine.rb +11 -0
  9. data/lib/extra_extra/semantic_html_renderer.rb +15 -0
  10. data/lib/extra_extra/version.rb +3 -0
  11. data/lib/extra_extra.rb +13 -0
  12. data/spec/controllers/release_notes_controller_spec.rb +16 -0
  13. data/spec/dummy/README.rdoc +28 -0
  14. data/spec/dummy/RELEASE_NOTES.md +39 -0
  15. data/spec/dummy/Rakefile +6 -0
  16. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  17. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  18. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  20. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/spec/dummy/bin/bundle +3 -0
  22. data/spec/dummy/bin/rails +4 -0
  23. data/spec/dummy/bin/rake +4 -0
  24. data/spec/dummy/config/application.rb +23 -0
  25. data/spec/dummy/config/boot.rb +5 -0
  26. data/spec/dummy/config/database.yml +25 -0
  27. data/spec/dummy/config/environment.rb +5 -0
  28. data/spec/dummy/config/environments/development.rb +37 -0
  29. data/spec/dummy/config/environments/production.rb +78 -0
  30. data/spec/dummy/config/environments/test.rb +39 -0
  31. data/spec/dummy/config/initializers/assets.rb +8 -0
  32. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  34. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  35. data/spec/dummy/config/initializers/inflections.rb +16 -0
  36. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  37. data/spec/dummy/config/initializers/session_store.rb +3 -0
  38. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  39. data/spec/dummy/config/locales/en.yml +23 -0
  40. data/spec/dummy/config/routes.rb +4 -0
  41. data/spec/dummy/config/secrets.yml +22 -0
  42. data/spec/dummy/config.ru +4 -0
  43. data/spec/dummy/db/development.sqlite3 +0 -0
  44. data/spec/dummy/db/schema.rb +16 -0
  45. data/spec/dummy/db/test.sqlite3 +0 -0
  46. data/spec/dummy/log/development.log +286 -0
  47. data/spec/dummy/log/test.log +161 -0
  48. data/spec/dummy/public/404.html +67 -0
  49. data/spec/dummy/public/422.html +67 -0
  50. data/spec/dummy/public/500.html +66 -0
  51. data/spec/dummy/public/favicon.ico +0 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/26e72fb7b344fb194bf85a05ed40bfc7 +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/362901df5349ae7671d0f126f551bf72 +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/3fd6b5fbae9ddd03cd56ec2d4aeb252e +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/787be44e3edd7fa7d35d1ea7d0890d39 +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/7cd55e6c26c32c33e14a0b472da6c339 +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/7cf17f0741235ed2e5e849dc5b0cdbbc +0 -0
  58. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  59. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  60. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  61. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  62. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  63. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  64. data/spec/lib/extra_extra/semantic_html_renderer_spec.rb +45 -0
  65. data/spec/spec_helper.rb +13 -0
  66. metadata +219 -0
@@ -0,0 +1,161 @@
1
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
+  (0.1ms) select sqlite_version(*)
3
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+  (0.1ms) SELECT version FROM "schema_migrations"
5
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
6
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
7
+  (0.1ms) select sqlite_version(*)
8
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
9
+  (0.1ms) SELECT version FROM "schema_migrations"
10
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
11
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
12
+  (0.1ms) select sqlite_version(*)
13
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+  (0.1ms) SELECT version FROM "schema_migrations"
15
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
16
+  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
17
+  (0.1ms) select sqlite_version(*)
18
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
19
+  (0.1ms) SELECT version FROM "schema_migrations"
20
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
21
+  (1.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
22
+  (0.2ms) select sqlite_version(*)
23
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
24
+  (0.1ms) SELECT version FROM "schema_migrations"
25
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
26
+  (0.2ms) begin transaction
27
+  (0.1ms) rollback transaction
28
+  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
29
+  (0.1ms) select sqlite_version(*)
30
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
31
+  (0.1ms) SELECT version FROM "schema_migrations"
32
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
33
+  (0.2ms) begin transaction
34
+  (0.1ms) rollback transaction
35
+  (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
36
+  (0.1ms) select sqlite_version(*)
37
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
38
+  (0.1ms) SELECT version FROM "schema_migrations"
39
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
40
+  (0.2ms) begin transaction
41
+  (0.0ms) rollback transaction
42
+  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
43
+  (0.1ms) select sqlite_version(*)
44
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
45
+  (0.1ms) SELECT version FROM "schema_migrations"
46
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
47
+  (0.2ms) begin transaction
48
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
49
+ Completed 500 Internal Server Error in 2ms
50
+  (0.1ms) rollback transaction
51
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
52
+  (0.1ms) select sqlite_version(*)
53
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
54
+  (0.1ms) SELECT version FROM "schema_migrations"
55
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
56
+  (0.2ms) begin transaction
57
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
58
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (2.1ms)
59
+ Completed 200 OK in 185ms (Views: 94.5ms | ActiveRecord: 0.0ms)
60
+  (0.1ms) rollback transaction
61
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
62
+  (0.1ms) select sqlite_version(*)
63
+  (1.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
64
+  (0.1ms) SELECT version FROM "schema_migrations"
65
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
66
+  (0.2ms) begin transaction
67
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
68
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (0.9ms)
69
+ Completed 200 OK in 10ms (Views: 9.7ms | ActiveRecord: 0.0ms)
70
+  (0.1ms) rollback transaction
71
+  (1.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
72
+  (0.1ms) select sqlite_version(*)
73
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
74
+  (0.1ms) SELECT version FROM "schema_migrations"
75
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
76
+  (0.3ms) begin transaction
77
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
78
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (1.3ms)
79
+ Completed 200 OK in 123ms (Views: 11.8ms | ActiveRecord: 0.0ms)
80
+  (0.1ms) rollback transaction
81
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
82
+  (0.1ms) select sqlite_version(*)
83
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
84
+  (0.1ms) SELECT version FROM "schema_migrations"
85
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
86
+  (0.2ms) begin transaction
87
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
88
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (1.9ms)
89
+ Completed 200 OK in 21ms (Views: 19.6ms | ActiveRecord: 0.0ms)
90
+  (0.1ms) rollback transaction
91
+  (0.2ms) begin transaction
92
+  (0.0ms) rollback transaction
93
+  (0.2ms) begin transaction
94
+  (0.1ms) rollback transaction
95
+  (0.2ms) begin transaction
96
+  (0.0ms) rollback transaction
97
+  (0.0ms) begin transaction
98
+  (0.0ms) rollback transaction
99
+  (0.2ms) begin transaction
100
+  (0.0ms) rollback transaction
101
+  (0.0ms) begin transaction
102
+  (0.0ms) rollback transaction
103
+  (0.2ms) begin transaction
104
+  (0.0ms) rollback transaction
105
+  (0.1ms) begin transaction
106
+  (0.1ms) rollback transaction
107
+  (0.0ms) begin transaction
108
+  (0.0ms) rollback transaction
109
+  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
110
+  (0.1ms) select sqlite_version(*)
111
+  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
112
+  (0.1ms) SELECT version FROM "schema_migrations"
113
+  (1.0ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
114
+  (0.2ms) begin transaction
115
+  (0.0ms) rollback transaction
116
+  (0.0ms) begin transaction
117
+  (0.0ms) rollback transaction
118
+  (0.0ms) begin transaction
119
+  (0.1ms) rollback transaction
120
+  (0.0ms) begin transaction
121
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
122
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (0.8ms)
123
+ Completed 200 OK in 10ms (Views: 9.2ms | ActiveRecord: 0.0ms)
124
+  (0.1ms) rollback transaction
125
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
126
+  (0.1ms) select sqlite_version(*)
127
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
128
+  (0.1ms) SELECT version FROM "schema_migrations"
129
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
130
+  (0.2ms) begin transaction
131
+  (0.1ms) rollback transaction
132
+  (0.0ms) begin transaction
133
+  (0.0ms) rollback transaction
134
+  (0.0ms) begin transaction
135
+  (0.0ms) rollback transaction
136
+  (0.1ms) begin transaction
137
+ Processing by ReleaseNotes::ReleaseNotesController#index as HTML
138
+ Rendered /Users/davec/Projects/stitchfix/release_notes/app/views/release_notes/release_notes/index.html.erb within layouts/application (0.9ms)
139
+ Completed 200 OK in 10ms (Views: 9.9ms | ActiveRecord: 0.0ms)
140
+  (0.1ms) rollback transaction
141
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
142
+  (0.4ms) select sqlite_version(*)
143
+  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
144
+  (0.1ms) SELECT version FROM "schema_migrations"
145
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
146
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
147
+  (0.1ms) select sqlite_version(*)
148
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
149
+  (0.1ms) SELECT version FROM "schema_migrations"
150
+  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
151
+  (0.3ms) begin transaction
152
+ Processing by ExtraExtra::ReleaseNotesController#index as HTML
153
+ Rendered /Users/davec/Projects/stitchfix/extra_extra/app/views/extra_extra/release_notes/index.html.erb within layouts/application (1.4ms)
154
+ Completed 200 OK in 121ms (Views: 16.9ms | ActiveRecord: 0.0ms)
155
+  (0.1ms) rollback transaction
156
+  (0.0ms) begin transaction
157
+  (0.1ms) rollback transaction
158
+  (0.0ms) begin transaction
159
+  (0.0ms) rollback transaction
160
+  (0.0ms) begin transaction
161
+  (0.0ms) rollback transaction
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+ require 'extra_extra/semantic_html_renderer'
3
+
4
+ describe ExtraExtra::SemanticHtmlRenderer do
5
+ let(:options) { {} }
6
+ let(:text) { "hello there!" }
7
+ let(:anchor) { "bloergh" }
8
+
9
+ subject(:renderer) { described_class.new(options) }
10
+
11
+ let(:h1) { renderer.header(text,1,anchor) }
12
+ let(:h2) { renderer.header(text,2,anchor) }
13
+ let(:h3) { renderer.header(text,3,anchor) }
14
+
15
+ describe "header rendering" do
16
+ context "default" do
17
+ it "renders everything as one smaller than Markdown would normally" do
18
+ expect(h1).to match(/<h2 class=["']h3["']>/)
19
+ expect(h2).to match(/<h3 class=["']h4["']>/)
20
+ expect(h3).to match(/<h4 class=["']h5["']>/)
21
+ end
22
+ end
23
+ context "customized" do
24
+ let(:options) {
25
+ {
26
+ header_level_offset: 0,
27
+ header_class_prefix: "f",
28
+ header_class_prefix_offset: 1,
29
+ }
30
+ }
31
+ it "renders everything based on the options provided" do
32
+ expect(h1).to match(/<h1 class=["']f2["']>/)
33
+ expect(h2).to match(/<h2 class=["']f3["']>/)
34
+ expect(h3).to match(/<h3 class=["']f4["']>/)
35
+ end
36
+ end
37
+
38
+ context "when anchor is omitted" do
39
+ let(:anchor) { nil }
40
+ it "parameterizes the title" do
41
+ expect(h1).to match(/<a name=["']hello-there["']>/)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,13 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
3
+ require 'rspec/rails'
4
+ Rails.backtrace_cleaner.remove_silencers!
5
+ # Load support files
6
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
7
+ RSpec.configure do |config|
8
+ config.mock_with :rspec
9
+ config.use_transactional_fixtures = true
10
+ config.infer_base_class_for_anonymous_controllers = false
11
+ config.infer_spec_type_from_file_location!
12
+ config.order = "random"
13
+ end