comfy_blog 0.0.0 → 0.1.0
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.
- data/README.md +48 -6
- data/VERSION +1 -1
- data/app/controllers/admin/blog/base_controller.rb +3 -0
- data/app/controllers/{blog/admin → admin/blog}/comments_controller.rb +1 -1
- data/app/controllers/{blog/admin → admin/blog}/posts_controller.rb +7 -7
- data/app/controllers/admin/blog/tags_controller.rb +56 -0
- data/app/controllers/blog/comments_controller.rb +35 -0
- data/app/controllers/blog/posts_controller.rb +8 -1
- data/app/helpers/blog/application_helper.rb +5 -2
- data/app/models/blog/comment.rb +11 -1
- data/app/models/blog/post.rb +8 -4
- data/app/models/blog/tag.rb +3 -3
- data/app/models/blog/tagging.rb +1 -1
- data/app/views/{blog/admin → admin/blog}/_html_head.html.erb +0 -0
- data/app/views/admin/blog/_navigation.html.erb +2 -0
- data/app/views/{blog/admin → admin/blog}/comments/_comment.html.erb +2 -2
- data/app/views/{blog/admin → admin/blog}/comments/destroy.js.erb +0 -0
- data/app/views/{blog/admin → admin/blog}/comments/index.html.erb +3 -1
- data/app/views/{blog/admin → admin/blog}/comments/publish.js.erb +0 -0
- data/app/views/{blog/admin → admin/blog}/posts/_form.html.erb +11 -0
- data/app/views/{blog/admin → admin/blog}/posts/_post.html.erb +4 -4
- data/app/views/{blog/admin → admin/blog}/posts/edit.html.erb +0 -0
- data/app/views/admin/blog/posts/index.html.erb +11 -0
- data/app/views/{blog/admin → admin/blog}/posts/new.html.erb +0 -0
- data/app/views/admin/blog/tags/_form.html.erb +20 -0
- data/app/views/admin/blog/tags/_tag.html.erb +16 -0
- data/app/views/admin/blog/tags/edit.html.erb +5 -0
- data/app/views/admin/blog/tags/index.html.erb +9 -0
- data/app/views/admin/blog/tags/new.html.erb +5 -0
- data/app/views/blog/comments/_comment.html.erb +4 -0
- data/app/views/blog/comments/_form.html.erb +6 -0
- data/app/views/blog/comments/create.js.erb +6 -0
- data/app/views/blog/posts/_post.html.erb +2 -12
- data/app/views/blog/posts/index.rss.builder +18 -0
- data/app/views/blog/posts/show.html.erb +9 -1
- data/comfy_blog.gemspec +33 -18
- data/config/initializers/comfy_blog.rb +7 -0
- data/config/initializers/wrap_parameters.rb +1 -1
- data/config/routes.rb +9 -7
- data/db/migrate/01_create_comfy_blog.rb +4 -5
- data/db/schema.rb +8 -9
- data/lib/comfy_blog/configuration.rb +20 -6
- data/lib/comfy_blog/engine.rb +6 -6
- data/lib/comfy_blog.rb +1 -1
- data/lib/generators/README +6 -6
- data/lib/generators/blog_generator.rb +3 -3
- data/lib/tasks/comfy_blog.rake +4 -0
- data/test/fixtures/blog/tags.yml +5 -0
- data/test/functional/{blog/admin → admin/blog}/comments_controller_test.rb +1 -1
- data/test/functional/{blog/admin → admin/blog}/posts_controller_test.rb +6 -8
- data/test/functional/admin/blog/tags_controller_test.rb +88 -0
- data/test/functional/blog/comments_controller_test.rb +78 -0
- data/test/functional/blog/posts_controller_test.rb +8 -0
- data/test/integration/routing_test.rb +26 -0
- data/test/test_helper.rb +9 -6
- data/test/unit/comment_test.rb +13 -1
- data/test/unit/configuration_test.rb +8 -5
- data/test/unit/post_test.rb +19 -0
- data/test/unit/tag_test.rb +2 -1
- metadata +42 -27
- data/app/controllers/blog/admin/base_controller.rb +0 -3
- data/app/views/blog/admin/_navigation.html.erb +0 -1
- data/app/views/blog/admin/posts/index.html.erb +0 -9
@@ -4,11 +4,14 @@ class ConfigurationTest < ActiveSupport::TestCase
|
|
4
4
|
|
5
5
|
def test_configuration
|
6
6
|
assert config = ComfyBlog.configuration
|
7
|
-
assert_equal '
|
8
|
-
assert_equal '',
|
9
|
-
assert_equal '
|
10
|
-
assert_equal '
|
11
|
-
assert_equal
|
7
|
+
assert_equal 'ComfyBlog', config.title
|
8
|
+
assert_equal 'A Simple Blog', config.description
|
9
|
+
assert_equal 'admin', config.admin_route_prefix
|
10
|
+
assert_equal '', config.public_route_prefix
|
11
|
+
assert_equal 'ApplicationController', config.admin_controller
|
12
|
+
assert_equal 'ComfyBlog::FormBuilder', config.form_builder
|
13
|
+
assert_equal 10, config.posts_per_page
|
14
|
+
assert_equal false, config.auto_publish_comments
|
12
15
|
end
|
13
16
|
|
14
17
|
def test_initialization_overrides
|
data/test/unit/post_test.rb
CHANGED
@@ -64,6 +64,15 @@ class PostTest < ActiveSupport::TestCase
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
+
def test_sync_tags_duplicate
|
68
|
+
post = blog_posts(:default)
|
69
|
+
|
70
|
+
post.tag_names = 'tag, category'
|
71
|
+
assert_no_difference ['Blog::Tagging.count'] do
|
72
|
+
post.save!
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
67
76
|
def test_sync_categories
|
68
77
|
post = blog_posts(:default)
|
69
78
|
assert_equal 1, post.tags.categories.count
|
@@ -118,4 +127,14 @@ class PostTest < ActiveSupport::TestCase
|
|
118
127
|
assert_equal 0, Blog::Post.categorized_as('invalid').count
|
119
128
|
end
|
120
129
|
|
130
|
+
def test_tag_names
|
131
|
+
assert_equal 'tag', blog_posts(:default).tag_names
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_category_ids
|
135
|
+
assert_equal ({
|
136
|
+
blog_tags(:category).id.to_s => '1'
|
137
|
+
}), blog_posts(:default).category_ids
|
138
|
+
end
|
139
|
+
|
121
140
|
end
|
data/test/unit/tag_test.rb
CHANGED
@@ -34,8 +34,9 @@ class TagTest < ActiveSupport::TestCase
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def test_scopes
|
37
|
-
assert_equal
|
37
|
+
assert_equal 2, Blog::Tag.tags.count
|
38
38
|
assert_equal blog_tags(:tag), Blog::Tag.tags.first
|
39
|
+
assert_equal blog_tags(:duplicate), Blog::Tag.tags.last
|
39
40
|
|
40
41
|
assert_equal 1, Blog::Tag.categories.count
|
41
42
|
assert_equal blog_tags(:category), Blog::Tag.categories.first
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: comfy_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-01-
|
13
|
+
date: 2012-01-20 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &70292918028660 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70292918028660
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: will_paginate
|
28
|
-
requirement: &
|
28
|
+
requirement: &70292918028060 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 3.0.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70292918028060
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rails_autolink
|
39
|
-
requirement: &
|
39
|
+
requirement: &70292918027460 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.0.4
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70292918027460
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: jquery-rails
|
50
|
-
requirement: &
|
50
|
+
requirement: &70292918026880 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: 1.0.0
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70292918026880
|
59
59
|
description: ''
|
60
60
|
email: oleg@twg.ca
|
61
61
|
executables: []
|
@@ -74,10 +74,12 @@ files:
|
|
74
74
|
- app/assets/stylesheets/comfy_blog/admin.css
|
75
75
|
- app/assets/stylesheets/comfy_blog/application.css
|
76
76
|
- app/assets/stylesheets/comfy_blog/reset.css
|
77
|
+
- app/controllers/admin/blog/base_controller.rb
|
78
|
+
- app/controllers/admin/blog/comments_controller.rb
|
79
|
+
- app/controllers/admin/blog/posts_controller.rb
|
80
|
+
- app/controllers/admin/blog/tags_controller.rb
|
77
81
|
- app/controllers/application_controller.rb
|
78
|
-
- app/controllers/blog/
|
79
|
-
- app/controllers/blog/admin/comments_controller.rb
|
80
|
-
- app/controllers/blog/admin/posts_controller.rb
|
82
|
+
- app/controllers/blog/comments_controller.rb
|
81
83
|
- app/controllers/blog/posts_controller.rb
|
82
84
|
- app/helpers/blog/application_helper.rb
|
83
85
|
- app/models/.gitkeep
|
@@ -85,19 +87,28 @@ files:
|
|
85
87
|
- app/models/blog/post.rb
|
86
88
|
- app/models/blog/tag.rb
|
87
89
|
- app/models/blog/tagging.rb
|
88
|
-
- app/views/blog/
|
89
|
-
- app/views/blog/
|
90
|
-
- app/views/blog/
|
91
|
-
- app/views/blog/
|
92
|
-
- app/views/blog/
|
93
|
-
- app/views/blog/
|
94
|
-
- app/views/blog/
|
95
|
-
- app/views/blog/
|
96
|
-
- app/views/blog/
|
97
|
-
- app/views/blog/
|
98
|
-
- app/views/blog/
|
90
|
+
- app/views/admin/blog/_html_head.html.erb
|
91
|
+
- app/views/admin/blog/_navigation.html.erb
|
92
|
+
- app/views/admin/blog/comments/_comment.html.erb
|
93
|
+
- app/views/admin/blog/comments/destroy.js.erb
|
94
|
+
- app/views/admin/blog/comments/index.html.erb
|
95
|
+
- app/views/admin/blog/comments/publish.js.erb
|
96
|
+
- app/views/admin/blog/posts/_form.html.erb
|
97
|
+
- app/views/admin/blog/posts/_post.html.erb
|
98
|
+
- app/views/admin/blog/posts/edit.html.erb
|
99
|
+
- app/views/admin/blog/posts/index.html.erb
|
100
|
+
- app/views/admin/blog/posts/new.html.erb
|
101
|
+
- app/views/admin/blog/tags/_form.html.erb
|
102
|
+
- app/views/admin/blog/tags/_tag.html.erb
|
103
|
+
- app/views/admin/blog/tags/edit.html.erb
|
104
|
+
- app/views/admin/blog/tags/index.html.erb
|
105
|
+
- app/views/admin/blog/tags/new.html.erb
|
106
|
+
- app/views/blog/comments/_comment.html.erb
|
107
|
+
- app/views/blog/comments/_form.html.erb
|
108
|
+
- app/views/blog/comments/create.js.erb
|
99
109
|
- app/views/blog/posts/_post.html.erb
|
100
110
|
- app/views/blog/posts/index.html.erb
|
111
|
+
- app/views/blog/posts/index.rss.builder
|
101
112
|
- app/views/blog/posts/show.html.erb
|
102
113
|
- app/views/layouts/application.html.erb
|
103
114
|
- comfy_blog.gemspec
|
@@ -124,6 +135,7 @@ files:
|
|
124
135
|
- lib/comfy_blog/form_builder.rb
|
125
136
|
- lib/generators/README
|
126
137
|
- lib/generators/blog_generator.rb
|
138
|
+
- lib/tasks/comfy_blog.rake
|
127
139
|
- script/rails
|
128
140
|
- test/fixtures/.gitkeep
|
129
141
|
- test/fixtures/blog/comments.yml
|
@@ -131,9 +143,12 @@ files:
|
|
131
143
|
- test/fixtures/blog/taggings.yml
|
132
144
|
- test/fixtures/blog/tags.yml
|
133
145
|
- test/functional/.gitkeep
|
134
|
-
- test/functional/blog/
|
135
|
-
- test/functional/blog/
|
146
|
+
- test/functional/admin/blog/comments_controller_test.rb
|
147
|
+
- test/functional/admin/blog/posts_controller_test.rb
|
148
|
+
- test/functional/admin/blog/tags_controller_test.rb
|
149
|
+
- test/functional/blog/comments_controller_test.rb
|
136
150
|
- test/functional/blog/posts_controller_test.rb
|
151
|
+
- test/integration/routing_test.rb
|
137
152
|
- test/test_helper.rb
|
138
153
|
- test/unit/.gitkeep
|
139
154
|
- test/unit/comment_test.rb
|
@@ -156,7 +171,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
171
|
version: '0'
|
157
172
|
segments:
|
158
173
|
- 0
|
159
|
-
hash:
|
174
|
+
hash: 4279942090542155642
|
160
175
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
176
|
none: false
|
162
177
|
requirements:
|
@@ -1 +0,0 @@
|
|
1
|
-
<li><%= active_link_to 'Blog posts', admin_posts_path %></li>
|