radiant 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of radiant might be problematic. Click here for more details.

Files changed (42) hide show
  1. data/CHANGELOG +1 -1
  2. data/CONTRIBUTORS +6 -0
  3. data/app/controllers/application.rb +1 -0
  4. data/app/helpers/admin/page_helper.rb +12 -1
  5. data/app/helpers/application_helper.rb +4 -0
  6. data/app/models/page_context.rb +1 -1
  7. data/app/models/response_cache.rb +2 -2
  8. data/app/views/admin/layout/index.rhtml +15 -15
  9. data/app/views/admin/layout/new.rhtml +13 -13
  10. data/app/views/admin/layout/remove.rhtml +9 -9
  11. data/app/views/admin/page/_node.rhtml +13 -14
  12. data/app/views/admin/page/_part.rhtml +8 -8
  13. data/app/views/admin/page/index.rhtml +44 -17
  14. data/app/views/admin/page/remove.rhtml +3 -3
  15. data/app/views/admin/snippet/index.rhtml +15 -15
  16. data/app/views/admin/snippet/new.rhtml +14 -14
  17. data/app/views/admin/snippet/remove.rhtml +8 -8
  18. data/app/views/admin/user/index.rhtml +19 -19
  19. data/app/views/admin/user/new.rhtml +26 -26
  20. data/app/views/admin/user/preferences.rhtml +13 -13
  21. data/app/views/admin/user/remove.rhtml +8 -8
  22. data/app/views/admin/welcome/login.rhtml +7 -7
  23. data/app/views/layouts/application.rhtml +50 -50
  24. data/bin/radiant +347 -244
  25. data/config/environment.rb +1 -1
  26. data/db/migrate/001_create_radiant_tables.rb +2 -0
  27. data/db/migrate/002_insert_initial_data.rb +12 -5
  28. data/lib/console_utils.rb +167 -0
  29. data/lib/radiant.rb +15 -2
  30. data/lib/tasks/release.rake +10 -6
  31. data/public/.htaccess +40 -0
  32. data/public/images/layout.png +0 -0
  33. data/public/images/new-layout.png +0 -0
  34. data/script/version +5 -0
  35. data/test/fixtures/pages.yml +39 -39
  36. data/test/functional/admin/page_controller_test.rb +47 -0
  37. data/test/functional/site_controller_test.rb +6 -0
  38. data/test/unit/page_context_test.rb +3 -1
  39. metadata +7 -6
  40. data/config/locomotive.yml +0 -6
  41. data/test/fixtures/pages.yml.rej +0 -28
  42. data/test/unit/page_context_test.rb.rej +0 -26
@@ -30,6 +30,41 @@ class Admin::PageControllerTest < Test::Unit::TestCase
30
30
  assert_kind_of Page, assigns(:homepage)
31
31
  end
32
32
 
33
+ def test_index__without_pages
34
+ Page.destroy_all
35
+ get :index
36
+ assert_response :success
37
+ assert_nil assigns(:homepage)
38
+ end
39
+
40
+ def test_index__without_cookies
41
+ get :index
42
+ assert_response :success
43
+ assert_rendered_nodes_where { |page| page.parent_id.nil? || page.parent.parent_id.nil? }
44
+ end
45
+
46
+ def test_index__with_empty_cookie
47
+ @request.cookies['expanded_rows'] = [""]
48
+ get :index
49
+ assert_response :success
50
+ assert_rendered_nodes_where { |page| page.parent_id.nil? }
51
+ end
52
+
53
+ def test_index__with_cookie
54
+ @request.cookies['expanded_rows'] = ["1,5,9,10,11,12,52"]
55
+ get :index
56
+ assert_response :success
57
+ assert_rendered_nodes_where { |page| [nil, 1, 5, 9, 52, 10, 11, 12].include?(page.parent_id) }
58
+ end
59
+
60
+ def test_index__with_mangled_cookie
61
+ @request.cookies['expanded_rows'] = ["1,5,:#*)&},9a,,,"]
62
+ get :index
63
+ assert_response :success
64
+ assert_rendered_nodes_where { |page| [nil, 1, 5].include?(page.parent_id) }
65
+ assert !assigns(:homepage).nil?
66
+ end
67
+
33
68
  def test_new
34
69
  @controller.config = { 'default.parts' => 'body, extended, summary' }
35
70
 
@@ -176,4 +211,16 @@ class Admin::PageControllerTest < Test::Unit::TestCase
176
211
  assert ! %r{<head>}.match(@response.body)
177
212
  assert_equal 'text/html;charset=utf-8', @response.headers['Content-Type']
178
213
  end
214
+
215
+ protected
216
+
217
+ def assert_rendered_nodes_where(&block)
218
+ wanted, unwanted = Page.find(:all).partition(&block)
219
+ wanted.each do |page|
220
+ assert_tag :tag => 'tr', :attributes => {:id => "page-#{page.id}" }
221
+ end
222
+ unwanted.each do |page|
223
+ assert_no_tag :tag => 'tr', :attributes => {:id => "page-#{page.id}" }
224
+ end
225
+ end
179
226
  end
@@ -156,6 +156,12 @@ class SiteControllerTest < Test::Unit::TestCase
156
156
  assert_equal 'This is the documentation section.', @response.body
157
157
  end
158
158
 
159
+ def test_show_page__no_pages
160
+ Page.destroy_all
161
+ get :show_page, :url => '/'
162
+ assert_redirected_to admin_url
163
+ end
164
+
159
165
  private
160
166
 
161
167
  def cache_file(path)
@@ -127,6 +127,8 @@ class PageContextTest < Test::Unit::TestCase
127
127
  assert_parse_output '', '<r:content part="sidebar" inherit="false" />'
128
128
  assert_parse_output 'Radius Test Page sidebar.', '<r:content part="sidebar" inherit="true" />'
129
129
  assert_parse_output_match %{`inherit' attribute of `content' tag must be set to either "true" or "false"}, '<r:content part="sidebar" inherit="weird value" />'
130
+
131
+ assert_parse_output '', '<r:content part="part_that_doesnt_exist" inherit="true" />'
130
132
  end
131
133
  def test_tag_content_with_inherit_and_contextual_attributes
132
134
  assert_parse_output 'Radius Test Page sidebar.', '<r:content part="sidebar" inherit="true" contextual="true" />'
@@ -372,4 +374,4 @@ class PageContextTest < Test::Unit::TestCase
372
374
  output = @parser.parse(input)
373
375
  assert_match regexp, output
374
376
  end
375
- end
377
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: radiant
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.0
7
- date: 2006-06-28 00:00:00 -05:00
6
+ version: 0.5.1
7
+ date: 2006-08-09 00:00:00 -04:00
8
8
  summary: A no-fluff content management system designed for small teams.
9
9
  require_paths:
10
10
  - lib
@@ -126,7 +126,6 @@ files:
126
126
  - config/database.sqlite.yml
127
127
  - config/environment.rb
128
128
  - config/environments
129
- - config/locomotive.yml
130
129
  - config/routes.rb
131
130
  - config/environments/development.rb
132
131
  - config/environments/production.rb
@@ -149,6 +148,7 @@ files:
149
148
  - db/templates/styled-blog.yml
150
149
  - lib/advanced_delegation.rb
151
150
  - lib/archive_index_behavior_tags_and_methods.rb
151
+ - lib/console_utils.rb
152
152
  - lib/generators
153
153
  - lib/inheritable_class_attributes.rb
154
154
  - lib/login_system.rb
@@ -188,6 +188,7 @@ files:
188
188
  - public/images/clear-page-cache.png
189
189
  - public/images/collapse.png
190
190
  - public/images/expand.png
191
+ - public/images/layout.png
191
192
  - public/images/minus.png
192
193
  - public/images/new-homepage.png
193
194
  - public/images/new-layout.png
@@ -222,6 +223,7 @@ files:
222
223
  - script/runner
223
224
  - script/server
224
225
  - script/setup_database
226
+ - script/version
225
227
  - script/performance/benchmarker
226
228
  - script/performance/profiler
227
229
  - script/process/reaper
@@ -236,7 +238,6 @@ files:
236
238
  - test/fixtures/layouts.yml
237
239
  - test/fixtures/page_parts.yml
238
240
  - test/fixtures/pages.yml
239
- - test/fixtures/pages.yml.rej
240
241
  - test/fixtures/snippets.yml
241
242
  - test/fixtures/users.yml
242
243
  - test/functional/admin
@@ -268,7 +269,6 @@ files:
268
269
  - test/unit/inheritable_class_attributes_test.rb
269
270
  - test/unit/layout_test.rb
270
271
  - test/unit/page_context_test.rb
271
- - test/unit/page_context_test.rb.rej
272
272
  - test/unit/page_part_test.rb
273
273
  - test/unit/page_test.rb
274
274
  - test/unit/radiant
@@ -288,6 +288,7 @@ files:
288
288
  - test/unit/filters/textile_filter_test.rb
289
289
  - test/unit/radiant/config_test.rb
290
290
  - test/unit/radiant/exporter_test.rb
291
+ - public/.htaccess
291
292
  test_files: []
292
293
 
293
294
  rdoc_options:
@@ -315,7 +316,7 @@ dependencies:
315
316
  requirements:
316
317
  - - "="
317
318
  - !ruby/object:Gem::Version
318
- version: 1.1.2
319
+ version: 1.1.5
319
320
  version:
320
321
  - !ruby/object:Gem::Dependency
321
322
  name: radius
@@ -1,6 +0,0 @@
1
- ---
2
- mode: development
3
- runs_at_launch: 0
4
- identifier: radiant
5
- port: 3000
6
- bundle: /Applications/Locomotive2/Bundles/rails112.locobundle
@@ -1,28 +0,0 @@
1
- ***************
2
- *** 333,336 ****
3
- status_id: 100
4
- layout_id: 2
5
- parent_id: 1
6
- - published_at: 2006-02-05 08:44:07 -05:00--- 333,354 ----
7
- status_id: 100
8
- layout_id: 2
9
- parent_id: 1
10
- + published_at: 2006-02-05 08:44:07 -05:00
11
- + tags:
12
- + id: 55
13
- + title: Tags
14
- + breadcrumb: Tags
15
- + slug: tags
16
- + behavior_id: Tag Display
17
- + status_id: 100
18
- + parent_id:
19
- + published_at: 2006-01-30 08:41:07 -05:00
20
- + tags_listing:
21
- + id: 56
22
- + title: Tagged
23
- + breadcrumb: Tagged
24
- + slug: tagged
25
- + behavior_id: Tag Listing
26
- + status_id: 100
27
- + parent_id: 55
28
- + published_at: 2006-01-30 08:41:07 -05:00
@@ -1,26 +0,0 @@
1
- ***************
2
- *** 262,267 ****
3
- assert_parse_output_match "undefined tag `missing'", '<r:missing />'
4
- end
5
-
6
- protected
7
-
8
- def setup_for_page(page)
9
- --- 262,278 ----
10
- assert_parse_output_match "undefined tag `missing'", '<r:missing />'
11
- end
12
-
13
- + def test_tag_tags_list
14
- + setup_for_page(:homepage)
15
- + expected = '<a href="/tags/lump">lump</a><a href="/tags/bar">bar</a><a href="/tags/test">test</a><a href="/tags/foo">foo</a>'
16
- + tags = '<r:tags url="/tags/"><r:link /></r:tags>'
17
- + assert_parse_output expected, tags
18
- + end
19
- +
20
- + def test_tag_tags_without_url
21
- + assert_parse_output_match "`tags' tag must include an 'url' attribute", %{<r:tags />}
22
- + end
23
- +
24
- protected
25
-
26
- def setup_for_page(page)