themes 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +15 -0
  2. data/README.md +55 -0
  3. data/Rakefile +5 -9
  4. data/lib/generators/themes/new_generator.rb +36 -0
  5. data/lib/generators/themes/templates/theme_loader.rb.erb +12 -0
  6. data/lib/themes.rb +5 -3
  7. data/lib/themes/engine.rb +4 -0
  8. data/lib/themes/environments.rb +17 -0
  9. data/lib/themes/version.rb +1 -1
  10. data/spec/controllers/posts_controller_spec.rb +29 -0
  11. data/spec/dummy/README.rdoc +261 -0
  12. data/spec/dummy/Rakefile +7 -0
  13. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  16. data/spec/dummy/app/controllers/posts_controller.rb +2 -0
  17. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  18. data/spec/dummy/app/mailers/notifier.rb +15 -0
  19. data/spec/dummy/app/views/layouts/application.html.erb +4 -0
  20. data/spec/dummy/app/views/notifier/good_bye_message.html.erb +3 -0
  21. data/spec/dummy/app/views/notifier/wellcome_message.html.erb +3 -0
  22. data/spec/dummy/app/views/posts/index.html.erb +1 -0
  23. data/spec/dummy/app/views/themes/test/layouts/application.html.erb +4 -0
  24. data/spec/dummy/app/views/themes/test/notifier/wellcome_message.html.erb +3 -0
  25. data/spec/dummy/app/views/themes/test/posts/index.html.erb +1 -0
  26. data/spec/dummy/config.ru +4 -0
  27. data/spec/dummy/config/application.rb +59 -0
  28. data/spec/dummy/config/boot.rb +10 -0
  29. data/spec/dummy/config/database.yml +26 -0
  30. data/spec/dummy/config/environment.rb +5 -0
  31. data/spec/dummy/config/environments/development.rb +37 -0
  32. data/spec/dummy/config/environments/production.rb +67 -0
  33. data/spec/dummy/config/environments/test.rb +37 -0
  34. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  35. data/spec/dummy/config/initializers/inflections.rb +15 -0
  36. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  37. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  38. data/spec/dummy/config/initializers/session_store.rb +8 -0
  39. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  40. data/spec/dummy/config/locales/en.yml +5 -0
  41. data/spec/dummy/config/routes.rb +58 -0
  42. data/spec/dummy/config/themes/test.rb +8 -0
  43. data/spec/dummy/log/test.log +264 -0
  44. data/spec/dummy/public/404.html +26 -0
  45. data/spec/dummy/public/422.html +26 -0
  46. data/spec/dummy/public/500.html +25 -0
  47. data/spec/dummy/public/favicon.ico +0 -0
  48. data/spec/dummy/script/rails +6 -0
  49. data/spec/generators/new_theme_generator_spec.rb +45 -0
  50. data/spec/mailer/notifier_spec.rb +21 -0
  51. data/spec/spec_helper.rb +49 -0
  52. data/spec/themes_engine_spec.rb +27 -0
  53. data/spec/tmp/config/themes/brand_new_theme.rb +20 -0
  54. metadata +145 -43
@@ -0,0 +1,8 @@
1
+ module Themes
2
+ class Loader
3
+ def self.configure(app)
4
+ app.config.theme.name = 'test'
5
+ app.config.theme.email = 'test@test.cat'
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,264 @@
1
+ Connecting to database specified by database.yml
2
+ Processing by PostsController#index as HTML
3
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
4
+ Completed 200 OK in 9ms (Views: 8.9ms | ActiveRecord: 0.0ms)
5
+ Processing by PostsController#index as HTML
6
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
7
+ Processing by PostsController#index as HTML
8
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
9
+ Connecting to database specified by database.yml
10
+ Processing by PostsController#index as HTML
11
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
12
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
13
+ Processing by PostsController#index as HTML
14
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
15
+ Processing by PostsController#index as HTML
16
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
17
+ Connecting to database specified by database.yml
18
+ Processing by PostsController#index as HTML
19
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
20
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
21
+ Processing by PostsController#index as HTML
22
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
23
+ Processing by PostsController#index as HTML
24
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
25
+ Connecting to database specified by database.yml
26
+ Processing by PostsController#index as HTML
27
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
28
+ Completed 200 OK in 12ms (Views: 11.7ms | ActiveRecord: 0.0ms)
29
+ Processing by PostsController#index as HTML
30
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
31
+ Processing by PostsController#index as HTML
32
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
33
+ Connecting to database specified by database.yml
34
+ Processing by PostsController#index as HTML
35
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
36
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
37
+ Processing by PostsController#index as HTML
38
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
39
+ Processing by PostsController#index as HTML
40
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
41
+ Connecting to database specified by database.yml
42
+ Processing by PostsController#index as HTML
43
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
44
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
45
+ Processing by PostsController#index as HTML
46
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
47
+ Processing by PostsController#index as HTML
48
+ Completed 200 OK in 1ms (Views: 0.8ms | ActiveRecord: 0.0ms)
49
+ Connecting to database specified by database.yml
50
+ Processing by PostsController#index as HTML
51
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
52
+ Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
53
+ Processing by PostsController#index as HTML
54
+ Completed 200 OK in 2ms (Views: 2.1ms | ActiveRecord: 0.0ms)
55
+ Processing by PostsController#index as HTML
56
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
57
+ Connecting to database specified by database.yml
58
+ Processing by PostsController#index as HTML
59
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
60
+ Completed 200 OK in 7ms (Views: 6.7ms | ActiveRecord: 0.0ms)
61
+ Processing by PostsController#index as HTML
62
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
63
+ Processing by PostsController#index as HTML
64
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
65
+ Connecting to database specified by database.yml
66
+ Processing by PostsController#index as HTML
67
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
68
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
69
+ Processing by PostsController#index as HTML
70
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
71
+ Processing by PostsController#index as HTML
72
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
73
+ Connecting to database specified by database.yml
74
+ Processing by PostsController#index as HTML
75
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
76
+ Completed 200 OK in 7ms (Views: 6.2ms | ActiveRecord: 0.0ms)
77
+ Processing by PostsController#index as HTML
78
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
79
+ Processing by PostsController#index as HTML
80
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
81
+ Connecting to database specified by database.yml
82
+ Processing by PostsController#index as HTML
83
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.4ms)
84
+ Completed 200 OK in 8ms (Views: 7.4ms | ActiveRecord: 0.0ms)
85
+ Processing by PostsController#index as HTML
86
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
87
+ Processing by PostsController#index as HTML
88
+ Completed 200 OK in 1ms (Views: 0.6ms | ActiveRecord: 0.0ms)
89
+ Connecting to database specified by database.yml
90
+ Processing by PostsController#index as HTML
91
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
92
+ Completed 200 OK in 6ms (Views: 5.7ms | ActiveRecord: 0.0ms)
93
+ Processing by PostsController#index as HTML
94
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
95
+ Processing by PostsController#index as HTML
96
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
97
+ Connecting to database specified by database.yml
98
+ Processing by PostsController#index as HTML
99
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
100
+ Completed 200 OK in 9ms (Views: 9.1ms | ActiveRecord: 0.0ms)
101
+ Processing by PostsController#index as HTML
102
+ Completed 200 OK in 3ms (Views: 2.6ms | ActiveRecord: 0.0ms)
103
+ Processing by PostsController#index as HTML
104
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
105
+ Connecting to database specified by database.yml
106
+ Processing by PostsController#index as HTML
107
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
108
+ Completed 200 OK in 10ms (Views: 9.4ms | ActiveRecord: 0.0ms)
109
+ Processing by PostsController#index as HTML
110
+ Completed 200 OK in 3ms (Views: 2.8ms | ActiveRecord: 0.0ms)
111
+ Processing by PostsController#index as HTML
112
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
113
+ Connecting to database specified by database.yml
114
+ Processing by PostsController#index as HTML
115
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
116
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
117
+ Processing by PostsController#index as HTML
118
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
119
+ Processing by PostsController#index as HTML
120
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
121
+ Connecting to database specified by database.yml
122
+ Processing by PostsController#index as HTML
123
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
124
+ Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)
125
+ Processing by PostsController#index as HTML
126
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
127
+ Processing by PostsController#index as HTML
128
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
129
+ Connecting to database specified by database.yml
130
+ Processing by PostsController#index as HTML
131
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
132
+ Completed 200 OK in 8ms (Views: 7.9ms | ActiveRecord: 0.0ms)
133
+ Processing by PostsController#index as HTML
134
+ Completed 200 OK in 2ms (Views: 2.2ms | ActiveRecord: 0.0ms)
135
+ Processing by PostsController#index as HTML
136
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
137
+ Connecting to database specified by database.yml
138
+ Processing by PostsController#index as HTML
139
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
140
+ Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms)
141
+ Processing by PostsController#index as HTML
142
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
143
+ Processing by PostsController#index as HTML
144
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
145
+ Connecting to database specified by database.yml
146
+ Processing by PostsController#index as HTML
147
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
148
+ Completed 200 OK in 6ms (Views: 6.2ms | ActiveRecord: 0.0ms)
149
+ Processing by PostsController#index as HTML
150
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
151
+ Processing by PostsController#index as HTML
152
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
153
+ Connecting to database specified by database.yml
154
+ Processing by PostsController#index as HTML
155
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
156
+ Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)
157
+ Processing by PostsController#index as HTML
158
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
159
+ Processing by PostsController#index as HTML
160
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
161
+ Connecting to database specified by database.yml
162
+ Processing by PostsController#index as HTML
163
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
164
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
165
+ Processing by PostsController#index as HTML
166
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
167
+ Processing by PostsController#index as HTML
168
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
169
+ Connecting to database specified by database.yml
170
+ Processing by PostsController#index as HTML
171
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
172
+ Completed 200 OK in 8ms (Views: 7.1ms | ActiveRecord: 0.0ms)
173
+ Processing by PostsController#index as HTML
174
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
175
+ Processing by PostsController#index as HTML
176
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
177
+ Connecting to database specified by database.yml
178
+ Processing by PostsController#index as HTML
179
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
180
+ Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
181
+ Processing by PostsController#index as HTML
182
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
183
+ Processing by PostsController#index as HTML
184
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
185
+ Connecting to database specified by database.yml
186
+ Processing by PostsController#index as HTML
187
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
188
+ Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
189
+ Processing by PostsController#index as HTML
190
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
191
+ Processing by PostsController#index as HTML
192
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
193
+ Connecting to database specified by database.yml
194
+ Processing by PostsController#index as HTML
195
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
196
+ Completed 200 OK in 7ms (Views: 6.4ms | ActiveRecord: 0.0ms)
197
+ Processing by PostsController#index as HTML
198
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
199
+ Processing by PostsController#index as HTML
200
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
201
+ Connecting to database specified by database.yml
202
+ Processing by PostsController#index as HTML
203
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
204
+ Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
205
+ Processing by PostsController#index as HTML
206
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
207
+ Processing by PostsController#index as HTML
208
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
209
+ Connecting to database specified by database.yml
210
+ Processing by PostsController#index as HTML
211
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
212
+ Completed 200 OK in 6ms (Views: 5.8ms | ActiveRecord: 0.0ms)
213
+ Processing by PostsController#index as HTML
214
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
215
+ Processing by PostsController#index as HTML
216
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
217
+ Connecting to database specified by database.yml
218
+ Processing by PostsController#index as HTML
219
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
220
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
221
+ Processing by PostsController#index as HTML
222
+ Completed 200 OK in 2ms (Views: 1.8ms | ActiveRecord: 0.0ms)
223
+ Processing by PostsController#index as HTML
224
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
225
+ Connecting to database specified by database.yml
226
+ Processing by PostsController#index as HTML
227
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
228
+ Completed 200 OK in 6ms (Views: 6.0ms | ActiveRecord: 0.0ms)
229
+ Processing by PostsController#index as HTML
230
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
231
+ Processing by PostsController#index as HTML
232
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
233
+ Connecting to database specified by database.yml
234
+ Processing by PostsController#index as HTML
235
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
236
+ Completed 200 OK in 6ms (Views: 6.1ms | ActiveRecord: 0.0ms)
237
+ Processing by PostsController#index as HTML
238
+ Completed 200 OK in 2ms (Views: 2.0ms | ActiveRecord: 0.0ms)
239
+ Processing by PostsController#index as HTML
240
+ Completed 200 OK in 1ms (Views: 0.4ms | ActiveRecord: 0.0ms)
241
+ Connecting to database specified by database.yml
242
+ Processing by PostsController#index as HTML
243
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
244
+ Completed 200 OK in 8ms (Views: 7.2ms | ActiveRecord: 0.0ms)
245
+ Processing by PostsController#index as HTML
246
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
247
+ Processing by PostsController#index as HTML
248
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
249
+ Connecting to database specified by database.yml
250
+ Processing by PostsController#index as HTML
251
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.3ms)
252
+ Completed 200 OK in 12ms (Views: 11.9ms | ActiveRecord: 0.0ms)
253
+ Processing by PostsController#index as HTML
254
+ Completed 200 OK in 3ms (Views: 2.5ms | ActiveRecord: 0.0ms)
255
+ Processing by PostsController#index as HTML
256
+ Completed 200 OK in 1ms (Views: 0.5ms | ActiveRecord: 0.0ms)
257
+ Connecting to database specified by database.yml
258
+ Processing by PostsController#index as HTML
259
+ Rendered themes/test/posts/index.html.erb within layouts/application (0.2ms)
260
+ Completed 200 OK in 6ms (Views: 5.9ms | ActiveRecord: 0.0ms)
261
+ Processing by PostsController#index as HTML
262
+ Completed 200 OK in 2ms (Views: 1.9ms | ActiveRecord: 0.0ms)
263
+ Processing by PostsController#index as HTML
264
+ Completed 200 OK in 1ms (Views: 0.7ms | ActiveRecord: 0.0ms)
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+ require 'generators/themes/new_generator'
3
+
4
+
5
+
6
+ describe Themes::NewGenerator do
7
+ destination File.expand_path("../../tmp", __FILE__)
8
+ arguments %w(brand_new_theme ricard@forniol.cat)
9
+
10
+ before(:all) do
11
+ prepare_destination
12
+ run_generator
13
+ end
14
+
15
+ it 'generates theme loader' do
16
+ assert_file "config/themes/brand_new_theme.rb", <<-FILE
17
+ # encoding: utf-8
18
+
19
+ class Themes::Loader
20
+ def self.configure(app)
21
+ app.config.theme.name = 'brand_new_theme'
22
+ app.config.theme.email = 'ricard@forniol.cat'
23
+
24
+ development do
25
+ # Place development environment stuff here
26
+ end
27
+
28
+ production do
29
+ # Place production environment stuff here
30
+ end
31
+
32
+ test do
33
+ # Place test environment stuff here
34
+ end
35
+ end
36
+ end
37
+ FILE
38
+ end
39
+
40
+ it do
41
+ expect(File.exists?("#{destination_root}/app/assets/javascripts/brand_new_theme")).to be_true
42
+ expect(File.exists?("#{destination_root}/app/assets/stylesheets/brand_new_theme")).to be_true
43
+ expect(File.exists?("#{destination_root}/app/views/themes/brand_new_theme/layouts")).to be_true
44
+ end
45
+ end
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ describe Notifier do
4
+ context "with custom" do
5
+ let(:user) { mock_model("User", email: 'test@test.cat') }
6
+ subject { Notifier.wellcome_message(user) }
7
+
8
+ describe "#body" do
9
+ it { expect(subject.body).to match /wellcome to this awsome app themed message/m}
10
+ end
11
+ end
12
+
13
+ context "with default" do
14
+ let(:user) { mock_model("User", email: 'test@test.cat') }
15
+ subject { Notifier.good_bye_message(user) }
16
+
17
+ describe "#body" do
18
+ it { expect(subject.body).to match /we are unhappy to see you leaving this app with default message/m}
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,49 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
5
+ SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
7
+ ]
8
+ SimpleCov.start do
9
+ add_filter '/spec/'
10
+ end
11
+
12
+ # Configure Rails Envinronment
13
+ ENV["RAILS_ENV"] = "test"
14
+ ENV["APP_THEME"] = 'test'
15
+
16
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
17
+ #require "rails/test_help"
18
+ require "rspec/rails"
19
+ require 'generator_spec'
20
+ require 'rspec/expectations'
21
+ require 'themes'
22
+
23
+ #Rails.backtrace_cleaner.remove_silencers!
24
+
25
+ #migrate_path = File.expand_path("../dummy/db/migrate", __FILE__)
26
+ #seeds_path = File.expand_path("../dummy/db/seeds.rb", __FILE__)
27
+ #
28
+ #ActiveRecord::Migrator.migrate(migrate_path)
29
+ #if File.exists?(seeds_path)
30
+ # load seeds_path
31
+ #end
32
+
33
+ RSpec.configure do |config|
34
+ # Remove this line if you don't want RSpec's should and should_not
35
+ # methods or matchers
36
+
37
+ #config.use_transactional_fixtures = false
38
+
39
+ config.include RSpec::Matchers
40
+ config.include RSpec::Rails::ControllerExampleGroup, type: :controller
41
+
42
+ config.include GeneratorSpec::GeneratorExampleGroup, type: :generator, example_group: {
43
+ file_path: config.escaped_path(%w[spec generators])
44
+ }
45
+
46
+
47
+ # == Mock Framework
48
+ config.mock_with :rspec
49
+ end