tb_blog 1.3.5 → 1.4.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/posts_controller.rb +1 -1
- data/lib/spud_blog/version.rb +1 -1
- data/spec/controllers/admin/posts_controller_spec.rb +4 -7
- data/spec/controllers/posts_controller_spec.rb +2 -2
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/rails_helper.rb +7 -0
- metadata +51 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeb69c01292f58e218b4ce91f77177d02821fc94
|
4
|
+
data.tar.gz: bbb9c52de3278d3fbb9883df111b9bac94990b11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72fc2e62be4d62466eff4b36698fa51b4cd7d24d50a7492b5423273ab2e1e18f635b1cc91dd2af1060f3d65940c727c5421b3b8fcd95167387bd827a66934a14
|
7
|
+
data.tar.gz: c02c76467d4473a580d5ab9b12acdec552eba806d573f104e18963bbe7ac9239e1c34962a8d289e0768c0fb1e81cccbcf312253b4b8da7428e8c10f6f6ae4cac
|
@@ -33,7 +33,7 @@ class PostsController < ApplicationController
|
|
33
33
|
|
34
34
|
def category
|
35
35
|
if @post_category = SpudPostCategory.find_by(url_name: params[:category_url_name])
|
36
|
-
@posts = @post_category.posts.for_user(current_user).visible.for_blog(params[:blog_key]).from_archive(params[:archive_date]).
|
36
|
+
@posts = @post_category.posts.for_user(current_user).visible.for_blog(params[:blog_key]).from_archive(params[:archive_date]).paginate(page: @page_number, per_page: Spud::Blog.config.posts_per_page)
|
37
37
|
else
|
38
38
|
redirect_to posts_path
|
39
39
|
return
|
data/lib/spud_blog/version.rb
CHANGED
@@ -13,13 +13,13 @@ describe Admin::PostsController, type: :controller do
|
|
13
13
|
|
14
14
|
it 'should create a redirect' do
|
15
15
|
expect do
|
16
|
-
put :update, id: @post.id, spud_post: { url_name: 'new-url' }, blog_key: 'blog'
|
16
|
+
put :update, params: { id: @post.id, spud_post: { url_name: 'new-url' }, blog_key: 'blog' }
|
17
17
|
end.to change(@post.tb_redirects, :count).by(1)
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'should not create a redirect' do
|
21
21
|
expect do
|
22
|
-
put :update, id: @post.id, spud_post: { title: 'Hello World' }, blog_key: 'blog'
|
22
|
+
put :update, params: { id: @post.id, spud_post: { title: 'Hello World' }, blog_key: 'blog' }
|
23
23
|
end.to_not change(@post.tb_redirects, :count)
|
24
24
|
end
|
25
25
|
end
|
@@ -28,7 +28,7 @@ describe Admin::PostsController, type: :controller do
|
|
28
28
|
context 'with a new post' do
|
29
29
|
it 'should set the attributes without saving' do
|
30
30
|
expect do
|
31
|
-
post :preview, blog_key: 'blog', post_id: nil, spud_post: { title: 'Hello World' }
|
31
|
+
post :preview, params: { blog_key: 'blog', post_id: nil, spud_post: { title: 'Hello World' } }
|
32
32
|
end.to_not change(SpudPost, :count)
|
33
33
|
end
|
34
34
|
end
|
@@ -36,10 +36,7 @@ describe Admin::PostsController, type: :controller do
|
|
36
36
|
it 'should set the attributes without saving' do
|
37
37
|
@post = FactoryGirl.create(:spud_post)
|
38
38
|
expect do
|
39
|
-
post :preview,
|
40
|
-
blog_key: @post.blog_key,
|
41
|
-
post_id: @post.id,
|
42
|
-
spud_post: { title: 'Hello World' }
|
39
|
+
post :preview, params: { blog_key: @post.blog_key, post_id: @post.id, spud_post: { title: 'Hello World' } }
|
43
40
|
@post.reload
|
44
41
|
end.to_not change(@post, :title)
|
45
42
|
end
|
@@ -9,7 +9,7 @@ describe PostsController, type: :controller do
|
|
9
9
|
describe 'index' do
|
10
10
|
it 'should display a list of posts' do
|
11
11
|
2.times { |_i| FactoryGirl.create(:spud_post) }
|
12
|
-
get :index, blog_key: 'blog'
|
12
|
+
get :index, params: { blog_key: 'blog' }
|
13
13
|
expect(assigns(:posts).count).to be > 1
|
14
14
|
end
|
15
15
|
|
@@ -21,7 +21,7 @@ describe PostsController, type: :controller do
|
|
21
21
|
{}
|
22
22
|
end
|
23
23
|
}
|
24
|
-
get :index, blog_key: 'blog'
|
24
|
+
get :index, params: { blog_key: 'blog' }
|
25
25
|
expect(assigns(:posts).count).to be 0
|
26
26
|
Spud::Blog.config.query_for_user = nil
|
27
27
|
end
|
@@ -9,7 +9,7 @@ Dummy::Application.configure do
|
|
9
9
|
|
10
10
|
# Configure static asset server for tests with Cache-Control for performance
|
11
11
|
config.serve_static_assets = true
|
12
|
-
config.
|
12
|
+
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
|
13
13
|
|
14
14
|
# Do not eager load code on boot. This avoids loading your whole application
|
15
15
|
# just for the purpose of running a single test. If you are using a tool that
|
data/spec/rails_helper.rb
CHANGED
@@ -4,6 +4,7 @@ ENV['RAILS_ENV'] ||= 'test'
|
|
4
4
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
5
|
require 'spec_helper'
|
6
6
|
require 'rspec/rails'
|
7
|
+
require 'rails-controller-testing'
|
7
8
|
require 'database_cleaner'
|
8
9
|
require 'simplecov'
|
9
10
|
require 'factory_girl_rails'
|
@@ -33,6 +34,12 @@ SimpleCov.start 'rails'
|
|
33
34
|
# ActiveRecord::Migration.maintain_test_schema!
|
34
35
|
|
35
36
|
RSpec.configure do |config|
|
37
|
+
[:controller, :view, :request].each do |type|
|
38
|
+
config.include ::Rails::Controller::Testing::TestProcess, type: type
|
39
|
+
config.include ::Rails::Controller::Testing::TemplateAssertions, type: type
|
40
|
+
config.include ::Rails::Controller::Testing::Integration, type: type
|
41
|
+
end
|
42
|
+
|
36
43
|
config.raise_errors_for_deprecations!
|
37
44
|
config.infer_base_class_for_anonymous_controllers = false
|
38
45
|
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_blog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Moser Consulting
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.0.0.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 5.0.0.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tb_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.4.beta2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.4.beta2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tb_redirects
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.0.beta1
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.0.beta1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tb_liquid
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 1.1.beta1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 1.1.beta1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: truncate_html
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,58 +98,72 @@ dependencies:
|
|
98
98
|
name: rspec-rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rails-controller-testing
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: factory_girl_rails
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
|
-
- - "
|
129
|
+
- - ">="
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
131
|
+
version: '0'
|
118
132
|
type: :development
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
|
-
- - "
|
136
|
+
- - ">="
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
138
|
+
version: '0'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: database_cleaner
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
|
-
- - "
|
143
|
+
- - ">="
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
145
|
+
version: '0'
|
132
146
|
type: :development
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
|
-
- - "
|
150
|
+
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
152
|
+
version: '0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: simplecov
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
|
-
- - "
|
157
|
+
- - ">="
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0
|
159
|
+
version: '0'
|
146
160
|
type: :development
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
|
-
- - "
|
164
|
+
- - ">="
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rubocop
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,7 +180,7 @@ dependencies:
|
|
166
180
|
version: '0'
|
167
181
|
description: Twice Baked blogging/news and rss engine.
|
168
182
|
email:
|
169
|
-
- greg@
|
183
|
+
- greg.woods@moserit.com
|
170
184
|
executables: []
|
171
185
|
extensions: []
|
172
186
|
extra_rdoc_files: []
|
@@ -307,7 +321,7 @@ files:
|
|
307
321
|
- spec/models/spud_post_spec.rb
|
308
322
|
- spec/rails_helper.rb
|
309
323
|
- spec/spec_helper.rb
|
310
|
-
homepage: http://bitbucket.org/
|
324
|
+
homepage: http://bitbucket.org/moser-inc/tb_blog
|
311
325
|
licenses: []
|
312
326
|
metadata: {}
|
313
327
|
post_install_message:
|
@@ -321,9 +335,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
321
335
|
version: '0'
|
322
336
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
323
337
|
requirements:
|
324
|
-
- - "
|
338
|
+
- - ">"
|
325
339
|
- !ruby/object:Gem::Version
|
326
|
-
version:
|
340
|
+
version: 1.3.1
|
327
341
|
requirements: []
|
328
342
|
rubyforge_project:
|
329
343
|
rubygems_version: 2.5.1
|