tb_blog 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -2
- data/app/assets/javascripts/admin/blog/posts.js +42 -0
- data/app/controllers/admin/post_categories_controller.rb +57 -57
- data/app/controllers/admin/posts_controller.rb +110 -101
- data/app/controllers/concerns/blog_url_helpers.rb +22 -18
- data/app/controllers/concerns/post_view_for_action.rb +11 -0
- data/app/controllers/posts_controller.rb +23 -34
- data/app/helpers/admin/posts_helper.rb +20 -20
- data/app/helpers/blog_helper.rb +21 -21
- data/app/models/spud/spud_post_model.rb +43 -51
- data/app/models/spud_blog_config.rb +2 -2
- data/app/models/spud_post.rb +1 -1
- data/app/models/spud_post_categories_post.rb +1 -1
- data/app/models/spud_post_category.rb +18 -20
- data/app/models/spud_post_site.rb +1 -1
- data/app/views/admin/posts/_form.html.erb +4 -3
- data/app/views/admin/posts/edit.html.erb +10 -2
- data/app/views/admin/posts/new.html.erb +9 -1
- data/app/views/admin/posts/show.html.erb +0 -0
- data/config/routes.rb +3 -1
- data/lib/generators/spud/blog/blog_generator.rb +5 -5
- data/lib/generators/spud/blog/random_posts_generator.rb +12 -14
- data/lib/generators/spud/blog/views_generator.rb +1 -1
- data/lib/spud_blog/configuration.rb +1 -2
- data/lib/spud_blog/engine.rb +12 -16
- data/lib/spud_blog/version.rb +3 -3
- data/lib/tasks/spud_blog_tasks.rake +1 -1
- data/lib/tb_blog.rb +2 -2
- data/spec/controllers/admin/posts_controller_spec.rb +28 -7
- data/spec/controllers/posts_controller_spec.rb +7 -7
- data/spec/dummy/config/application.rb +2 -3
- data/spec/dummy/config/boot.rb +1 -1
- data/spec/dummy/config/environment.rb +2 -2
- data/spec/dummy/config/environments/test.rb +3 -3
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/db/migrate/{20120610130206_create_spud_admin_permissions.spud_core.rb → 20161020155425_create_spud_admin_permissions.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/20161020155426_create_spud_users.tb_core.rb +30 -0
- data/spec/dummy/db/migrate/{20120610130208_add_time_zone_to_spud_user.spud_core.rb → 20161020155427_add_time_zone_to_spud_user.tb_core.rb} +1 -2
- data/spec/dummy/db/migrate/{20120610130209_add_scope_to_spud_admin_permissions.spud_core.rb → 20161020155428_add_scope_to_spud_admin_permissions.tb_core.rb} +1 -2
- data/spec/dummy/db/migrate/{20120610130210_create_spud_user_settings.spud_core.rb → 20161020155429_create_spud_user_settings.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/{20140110180411_create_spud_roles.tb_core.rb → 20161020155430_create_spud_roles.tb_core.rb} +0 -0
- data/spec/dummy/db/migrate/{20140110180412_create_spud_permissions.tb_core.rb → 20161020155431_create_spud_permissions.tb_core.rb} +3 -3
- data/spec/dummy/db/migrate/{20140110180413_create_spud_role_permissions.tb_core.rb → 20161020155432_create_spud_role_permissions.tb_core.rb} +2 -2
- data/spec/dummy/db/migrate/{20140110180414_drop_spud_admin_permissions.tb_core.rb → 20161020155433_drop_spud_admin_permissions.tb_core.rb} +0 -0
- data/spec/dummy/db/migrate/{20160215174632_add_requires_password_change_to_spud_users.tb_core.rb → 20161020155434_add_requires_password_change_to_spud_users.tb_core.rb} +1 -1
- data/spec/dummy/db/migrate/{20160215174633_create_tb_redirects.tb_redirects.rb → 20161020155435_create_tb_redirects.tb_redirects.rb} +3 -3
- data/spec/dummy/db/migrate/{20140113162805_create_tb_liquid_spud_liquid_tags.tb_liquid.rb → 20161020155436_create_tb_liquid_spud_liquid_tags.tb_liquid.rb} +0 -0
- data/spec/dummy/db/migrate/{20140110180418_create_spud_posts.tb_blog.rb → 20161020155437_create_spud_posts.tb_blog.rb} +3 -3
- data/spec/dummy/db/migrate/{20140110180419_create_spud_post_categories.tb_blog.rb → 20161020155438_create_spud_post_categories.tb_blog.rb} +4 -4
- data/spec/dummy/db/migrate/{20140110180421_add_url_to_spud_posts.tb_blog.rb → 20161020155439_add_url_to_spud_posts.tb_blog.rb} +2 -2
- data/spec/dummy/db/migrate/20161020155440_add_url_to_spud_post_categories.tb_blog.rb +9 -0
- data/spec/dummy/db/migrate/{20140110180423_add_is_news_to_spud_posts.tb_blog.rb → 20161020155441_add_is_news_to_spud_posts.tb_blog.rb} +2 -2
- data/spec/dummy/db/migrate/{20140110180424_add_meta_to_posts.tb_blog.rb → 20161020155442_add_meta_to_posts.tb_blog.rb} +0 -0
- data/spec/dummy/db/migrate/{20140110180426_create_spud_post_sites.tb_blog.rb → 20161020155443_create_spud_post_sites.tb_blog.rb} +3 -3
- data/spec/dummy/db/migrate/{20140110180429_add_nested_set_to_post_categories.tb_blog.rb → 20161020155444_add_nested_set_to_post_categories.tb_blog.rb} +1 -5
- data/spec/dummy/db/migrate/{20140110180430_add_content_format_to_spud_posts.tb_blog.rb → 20161020155445_add_content_format_to_spud_posts.tb_blog.rb} +1 -1
- data/spec/dummy/db/migrate/{20140110180431_add_content_processed_to_spud_post.tb_blog.rb → 20161020155446_add_content_processed_to_spud_post.tb_blog.rb} +0 -0
- data/spec/dummy/db/migrate/{20140730131549_add_primary_key_to_spud_post_categories_posts.tb_blog.rb → 20161020155447_add_primary_key_to_spud_post_categories_posts.tb_blog.rb} +0 -0
- data/spec/dummy/db/migrate/{20140730131550_remove_awesome_nested_set_columns_from_spud_post_categories.tb_blog.rb → 20161020155448_remove_awesome_nested_set_columns_from_spud_post_categories.tb_blog.rb} +2 -1
- data/spec/dummy/db/migrate/{20140811161502_add_blog_key_to_spud_posts.tb_blog.rb → 20161020155449_add_blog_key_to_spud_posts.tb_blog.rb} +0 -0
- data/spec/dummy/db/migrate/{20150116195007_drop_spud_post_sites.tb_blog.rb → 20161020155450_drop_spud_post_sites.tb_blog.rb} +4 -3
- data/spec/dummy/db/migrate/{20151015154040_add_custom_author_to_post.tb_blog.rb → 20161020155451_add_custom_author_to_post.tb_blog.rb} +1 -1
- data/spec/dummy/db/migrate/{20160216150847_add_identifier_to_spud_posts.tb_blog.rb → 20161020155452_add_identifier_to_spud_posts.tb_blog.rb} +1 -1
- data/spec/dummy/db/schema.rb +106 -118
- data/spec/dummy/script/rails +2 -2
- data/spec/factories/spud_post_factories.rb +2 -2
- data/spec/helpers/admin/posts_helper_spec.rb +1 -1
- data/spec/models/spud_post_spec.rb +4 -4
- data/spec/rails_helper.rb +5 -5
- data/spec/spec_helper.rb +42 -44
- metadata +77 -79
- data/spec/dummy/db/migrate/20120610130207_create_spud_users.spud_core.rb +0 -30
- data/spec/dummy/db/migrate/20140110180415_create_spud_permalinks.tb_permalinks.rb +0 -12
- data/spec/dummy/db/migrate/20140110180416_add_site_id_to_spud_permalinks.tb_permalinks.rb +0 -7
- data/spec/dummy/db/migrate/20140110180417_modify_site_id_for_spud_permalinks.tb_permalinks.rb +0 -12
- data/spec/dummy/db/migrate/20140110180420_create_spud_post_comments.tb_blog.rb +0 -14
- data/spec/dummy/db/migrate/20140110180422_add_url_to_spud_post_categories.tb_blog.rb +0 -9
- data/spec/dummy/db/migrate/20140110180425_add_comments_counter_to_spud_posts.tb_blog.rb +0 -13
- data/spec/dummy/db/migrate/20140110180427_add_spam_fields_to_spud_post_comments.tb_blog.rb +0 -9
- data/spec/dummy/db/migrate/20140110180428_add_permalink_to_spud_post_comments.tb_blog.rb +0 -6
- data/spec/dummy/db/migrate/20140811161503_add_blog_key_to_spud_post_comments.tb_blog.rb +0 -7
- data/spec/dummy/db/migrate/20160216153113_drop_spud_post_comments.rb +0 -29
data/spec/dummy/db/schema.rb
CHANGED
@@ -11,147 +11,135 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
15
|
-
|
16
|
-
create_table
|
17
|
-
t.integer
|
18
|
-
t.string
|
19
|
-
t.string
|
20
|
-
t.string
|
21
|
-
t.datetime
|
22
|
-
t.datetime
|
14
|
+
ActiveRecord::Schema.define(version: 20_161_020_155_452) do
|
15
|
+
|
16
|
+
create_table 'spud_liquid_tags', force: :cascade do |t|
|
17
|
+
t.integer 'attachment_id', limit: 4
|
18
|
+
t.string 'attachment_type', limit: 255
|
19
|
+
t.string 'tag_name', limit: 255
|
20
|
+
t.string 'value', limit: 255
|
21
|
+
t.datetime 'created_at'
|
22
|
+
t.datetime 'updated_at'
|
23
23
|
end
|
24
24
|
|
25
|
-
add_index
|
25
|
+
add_index 'spud_liquid_tags', ['tag_name', 'value'], name: 'index_spud_liquid_tags_on_tag_name_and_value', using: :btree
|
26
26
|
|
27
|
-
create_table
|
28
|
-
t.string
|
29
|
-
t.string
|
30
|
-
t.
|
31
|
-
t.datetime
|
32
|
-
t.datetime "updated_at"
|
33
|
-
t.integer "site_id", limit: 4, default: 0, null: false
|
27
|
+
create_table 'spud_permissions', force: :cascade do |t|
|
28
|
+
t.string 'name', limit: 255, null: false
|
29
|
+
t.string 'tag', limit: 255, null: false
|
30
|
+
t.datetime 'created_at'
|
31
|
+
t.datetime 'updated_at'
|
34
32
|
end
|
35
33
|
|
36
|
-
add_index
|
37
|
-
add_index "spud_permalinks", ["site_id"], name: "idx_permalinks_site_id", using: :btree
|
34
|
+
add_index 'spud_permissions', ['tag'], name: 'index_spud_permissions_on_tag', unique: true, using: :btree
|
38
35
|
|
39
|
-
create_table
|
40
|
-
t.string
|
41
|
-
t.
|
42
|
-
t.datetime
|
43
|
-
t.
|
36
|
+
create_table 'spud_post_categories', force: :cascade do |t|
|
37
|
+
t.string 'name', limit: 255
|
38
|
+
t.datetime 'created_at'
|
39
|
+
t.datetime 'updated_at'
|
40
|
+
t.string 'url_name', limit: 255
|
44
41
|
end
|
45
42
|
|
46
|
-
add_index
|
43
|
+
add_index 'spud_post_categories', ['url_name'], name: 'index_spud_post_categories_on_url_name', using: :btree
|
47
44
|
|
48
|
-
create_table
|
49
|
-
t.
|
50
|
-
t.
|
51
|
-
t.datetime "updated_at"
|
52
|
-
t.string "url_name", limit: 255
|
45
|
+
create_table 'spud_post_categories_posts', force: :cascade do |t|
|
46
|
+
t.integer 'spud_post_id', limit: 4
|
47
|
+
t.integer 'spud_post_category_id', limit: 4
|
53
48
|
end
|
54
49
|
|
55
|
-
add_index
|
56
|
-
|
57
|
-
create_table
|
58
|
-
t.integer
|
59
|
-
t.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
t.
|
66
|
-
t.string
|
67
|
-
t.
|
68
|
-
t.
|
69
|
-
t.
|
70
|
-
t.
|
71
|
-
t.
|
72
|
-
t.
|
73
|
-
t.string
|
74
|
-
t.
|
75
|
-
t.string "meta_keywords", limit: 255
|
76
|
-
t.text "meta_description", limit: 65535
|
77
|
-
t.string "content_format", limit: 255, default: "HTML"
|
78
|
-
t.text "content_processed", limit: 65535
|
79
|
-
t.string "blog_key", limit: 255
|
80
|
-
t.string "custom_author", limit: 255
|
81
|
-
t.string "identifier", limit: 255
|
50
|
+
add_index 'spud_post_categories_posts', ['spud_post_category_id'], name: 'index_spud_post_categories_posts_on_spud_post_category_id', using: :btree
|
51
|
+
|
52
|
+
create_table 'spud_posts', force: :cascade do |t|
|
53
|
+
t.integer 'spud_user_id', limit: 4
|
54
|
+
t.string 'title', limit: 255
|
55
|
+
t.text 'content', limit: 65_535
|
56
|
+
t.boolean 'comments_enabled', default: false
|
57
|
+
t.boolean 'visible', default: true
|
58
|
+
t.datetime 'published_at'
|
59
|
+
t.datetime 'created_at'
|
60
|
+
t.datetime 'updated_at'
|
61
|
+
t.string 'url_name', limit: 255
|
62
|
+
t.boolean 'is_news', default: false
|
63
|
+
t.string 'meta_keywords', limit: 255
|
64
|
+
t.text 'meta_description', limit: 65_535
|
65
|
+
t.string 'content_format', limit: 255, default: 'HTML'
|
66
|
+
t.text 'content_processed', limit: 65_535
|
67
|
+
t.string 'blog_key', limit: 255
|
68
|
+
t.string 'custom_author', limit: 255
|
69
|
+
t.string 'identifier', limit: 255
|
82
70
|
end
|
83
71
|
|
84
|
-
add_index
|
85
|
-
add_index
|
86
|
-
add_index
|
87
|
-
add_index
|
88
|
-
add_index
|
89
|
-
add_index
|
90
|
-
|
91
|
-
create_table
|
92
|
-
t.integer
|
93
|
-
t.string
|
94
|
-
t.datetime
|
95
|
-
t.datetime
|
72
|
+
add_index 'spud_posts', ['blog_key'], name: 'index_spud_posts_on_blog_key', using: :btree
|
73
|
+
add_index 'spud_posts', ['identifier'], name: 'index_spud_posts_on_identifier', unique: true, using: :btree
|
74
|
+
add_index 'spud_posts', ['is_news'], name: 'index_spud_posts_on_is_news', using: :btree
|
75
|
+
add_index 'spud_posts', ['spud_user_id'], name: 'index_spud_posts_on_spud_user_id', using: :btree
|
76
|
+
add_index 'spud_posts', ['url_name'], name: 'index_spud_posts_on_url_name', using: :btree
|
77
|
+
add_index 'spud_posts', ['visible'], name: 'index_spud_posts_on_visible', using: :btree
|
78
|
+
|
79
|
+
create_table 'spud_role_permissions', force: :cascade do |t|
|
80
|
+
t.integer 'spud_role_id', limit: 4, null: false
|
81
|
+
t.string 'spud_permission_tag', limit: 255, null: false
|
82
|
+
t.datetime 'created_at'
|
83
|
+
t.datetime 'updated_at'
|
96
84
|
end
|
97
85
|
|
98
|
-
add_index
|
99
|
-
add_index
|
86
|
+
add_index 'spud_role_permissions', ['spud_permission_tag'], name: 'index_spud_role_permissions_on_spud_permission_tag', using: :btree
|
87
|
+
add_index 'spud_role_permissions', ['spud_role_id'], name: 'index_spud_role_permissions_on_spud_role_id', using: :btree
|
100
88
|
|
101
|
-
create_table
|
102
|
-
t.string
|
103
|
-
t.datetime
|
104
|
-
t.datetime
|
89
|
+
create_table 'spud_roles', force: :cascade do |t|
|
90
|
+
t.string 'name', limit: 255
|
91
|
+
t.datetime 'created_at'
|
92
|
+
t.datetime 'updated_at'
|
105
93
|
end
|
106
94
|
|
107
|
-
create_table
|
108
|
-
t.integer
|
109
|
-
t.string
|
110
|
-
t.string
|
111
|
-
t.datetime
|
112
|
-
t.datetime
|
95
|
+
create_table 'spud_user_settings', force: :cascade do |t|
|
96
|
+
t.integer 'spud_user_id', limit: 4
|
97
|
+
t.string 'key', limit: 255
|
98
|
+
t.string 'value', limit: 255
|
99
|
+
t.datetime 'created_at'
|
100
|
+
t.datetime 'updated_at'
|
113
101
|
end
|
114
102
|
|
115
|
-
create_table
|
116
|
-
t.string
|
117
|
-
t.string
|
118
|
-
t.boolean
|
119
|
-
t.string
|
120
|
-
t.string
|
121
|
-
t.string
|
122
|
-
t.string
|
123
|
-
t.string
|
124
|
-
t.string
|
125
|
-
t.string
|
126
|
-
t.integer
|
127
|
-
t.integer
|
128
|
-
t.datetime
|
129
|
-
t.datetime
|
130
|
-
t.datetime
|
131
|
-
t.string
|
132
|
-
t.string
|
133
|
-
t.datetime
|
134
|
-
t.datetime
|
135
|
-
t.string
|
136
|
-
t.integer
|
137
|
-
t.boolean
|
103
|
+
create_table 'spud_users', force: :cascade do |t|
|
104
|
+
t.string 'first_name', limit: 255
|
105
|
+
t.string 'last_name', limit: 255
|
106
|
+
t.boolean 'super_admin'
|
107
|
+
t.string 'login', limit: 255, null: false
|
108
|
+
t.string 'email', limit: 255, null: false
|
109
|
+
t.string 'crypted_password', limit: 255, null: false
|
110
|
+
t.string 'password_salt', limit: 255, null: false
|
111
|
+
t.string 'persistence_token', limit: 255, null: false
|
112
|
+
t.string 'single_access_token', limit: 255, null: false
|
113
|
+
t.string 'perishable_token', limit: 255, null: false
|
114
|
+
t.integer 'login_count', limit: 4, default: 0, null: false
|
115
|
+
t.integer 'failed_login_count', limit: 4, default: 0, null: false
|
116
|
+
t.datetime 'last_request_at'
|
117
|
+
t.datetime 'current_login_at'
|
118
|
+
t.datetime 'last_login_at'
|
119
|
+
t.string 'current_login_ip', limit: 255
|
120
|
+
t.string 'last_login_ip', limit: 255
|
121
|
+
t.datetime 'created_at'
|
122
|
+
t.datetime 'updated_at'
|
123
|
+
t.string 'time_zone', limit: 255
|
124
|
+
t.integer 'spud_role_id', limit: 4
|
125
|
+
t.boolean 'requires_password_change', default: false
|
138
126
|
end
|
139
127
|
|
140
|
-
add_index
|
141
|
-
add_index
|
142
|
-
add_index
|
143
|
-
|
144
|
-
create_table
|
145
|
-
t.string
|
146
|
-
t.integer
|
147
|
-
t.string
|
148
|
-
t.string
|
149
|
-
t.string
|
150
|
-
t.datetime
|
151
|
-
t.datetime
|
128
|
+
add_index 'spud_users', ['email'], name: 'index_spud_users_on_email', using: :btree
|
129
|
+
add_index 'spud_users', ['login'], name: 'index_spud_users_on_login', using: :btree
|
130
|
+
add_index 'spud_users', ['spud_role_id'], name: 'index_spud_users_on_spud_role_id', using: :btree
|
131
|
+
|
132
|
+
create_table 'tb_redirects', force: :cascade do |t|
|
133
|
+
t.string 'owner_type', limit: 255
|
134
|
+
t.integer 'owner_id', limit: 4
|
135
|
+
t.string 'source', limit: 255, null: false
|
136
|
+
t.string 'destination', limit: 255, null: false
|
137
|
+
t.string 'created_by', limit: 255
|
138
|
+
t.datetime 'created_at', null: false
|
139
|
+
t.datetime 'updated_at', null: false
|
152
140
|
end
|
153
141
|
|
154
|
-
add_index
|
155
|
-
add_index
|
142
|
+
add_index 'tb_redirects', ['owner_type', 'owner_id'], name: 'index_tb_redirects_on_owner_type_and_owner_id', using: :btree
|
143
|
+
add_index 'tb_redirects', ['source'], name: 'index_tb_redirects_on_source', unique: true, using: :btree
|
156
144
|
|
157
145
|
end
|
data/spec/dummy/script/rails
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
3
|
|
4
|
-
APP_PATH = File.expand_path('../../config/application',
|
5
|
-
require File.expand_path('../../config/boot',
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
6
|
require 'rails/commands'
|
@@ -7,11 +7,11 @@ FactoryGirl.define do
|
|
7
7
|
factory :spud_post do
|
8
8
|
author { FactoryGirl.create(:spud_user) }
|
9
9
|
title { FactoryGirl.generate(:spud_post_title) }
|
10
|
-
content
|
10
|
+
content 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
11
11
|
comments_enabled true
|
12
12
|
visible true
|
13
13
|
published_at DateTime.now
|
14
|
-
content_format
|
14
|
+
content_format 'HTML'
|
15
15
|
blog_key 'blog'
|
16
16
|
end
|
17
17
|
|
@@ -8,7 +8,7 @@ RSpec.describe Admin::PostsHelper, type: :helper do
|
|
8
8
|
result = helper.link_to_disqus_comment_count(post)
|
9
9
|
|
10
10
|
expect(result).to include("data-disqus-identifier=\"#{post.identifier}\"")
|
11
|
-
expect(result).to include(
|
11
|
+
expect(result).to include('testblog.disqus.com')
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
RSpec.describe SpudPost, :
|
4
|
-
|
3
|
+
RSpec.describe SpudPost, type: :model do
|
4
|
+
|
5
5
|
describe '#display_date' do
|
6
6
|
it 'should return a date string' do
|
7
7
|
post = FactoryGirl.create(:spud_post)
|
8
|
-
expect(post.display_date).to eq(post.published_at.strftime(
|
8
|
+
expect(post.display_date).to eq(post.published_at.strftime('%b %d, %Y'))
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe '#set_identifier' do
|
13
13
|
it 'should set a random identifier' do
|
14
|
-
post = FactoryGirl.create(:spud_post, :
|
14
|
+
post = FactoryGirl.create(:spud_post, identifier: nil)
|
15
15
|
expect(post.identifier).to be_a(String)
|
16
16
|
end
|
17
17
|
end
|
data/spec/rails_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV[
|
2
|
+
ENV['RAILS_ENV'] ||= 'test'
|
3
3
|
|
4
|
-
require File.expand_path(
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
5
|
require 'spec_helper'
|
6
6
|
require 'rspec/rails'
|
7
7
|
require 'database_cleaner'
|
@@ -30,12 +30,12 @@ SimpleCov.start 'rails'
|
|
30
30
|
|
31
31
|
# Checks for pending migrations before tests are run.
|
32
32
|
# If you are not using ActiveRecord, you can remove this line.
|
33
|
-
#ActiveRecord::Migration.maintain_test_schema!
|
33
|
+
# ActiveRecord::Migration.maintain_test_schema!
|
34
34
|
|
35
35
|
RSpec.configure do |config|
|
36
36
|
config.raise_errors_for_deprecations!
|
37
37
|
config.infer_base_class_for_anonymous_controllers = false
|
38
|
-
|
38
|
+
|
39
39
|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
40
40
|
# examples within a transaction, remove the following line or assign false
|
41
41
|
# instead of true.
|
@@ -67,5 +67,5 @@ RSpec.configure do |config|
|
|
67
67
|
example.run
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
70
|
+
|
71
71
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -38,48 +38,46 @@ RSpec.configure do |config|
|
|
38
38
|
mocks.verify_partial_doubles = true
|
39
39
|
end
|
40
40
|
|
41
|
-
# The settings below are suggested to provide a good initial experience
|
42
|
-
# with RSpec, but feel free to customize to your heart's content.
|
43
|
-
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
config.
|
49
|
-
|
50
|
-
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# - http://
|
54
|
-
# - http://
|
55
|
-
#
|
56
|
-
|
57
|
-
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
|
72
|
-
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
|
78
|
-
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
Kernel.srand config.seed
|
84
|
-
=end
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
# # These two settings work together to allow you to limit a spec run
|
44
|
+
# # to individual examples or groups you care about by tagging them with
|
45
|
+
# # `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
46
|
+
# # get run.
|
47
|
+
# config.filter_run :focus
|
48
|
+
# config.run_all_when_everything_filtered = true
|
49
|
+
#
|
50
|
+
# # Limits the available syntax to the non-monkey patched syntax that is recommended.
|
51
|
+
# # For more details, see:
|
52
|
+
# # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
53
|
+
# # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
54
|
+
# # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
55
|
+
# config.disable_monkey_patching!
|
56
|
+
#
|
57
|
+
# # Many RSpec users commonly either run the entire suite or an individual
|
58
|
+
# # file, and it's useful to allow more verbose output when running an
|
59
|
+
# # individual spec file.
|
60
|
+
# if config.files_to_run.one?
|
61
|
+
# # Use the documentation formatter for detailed output,
|
62
|
+
# # unless a formatter has already been configured
|
63
|
+
# # (e.g. via a command-line flag).
|
64
|
+
# config.default_formatter = 'doc'
|
65
|
+
# end
|
66
|
+
#
|
67
|
+
# # Print the 10 slowest examples and example groups at the
|
68
|
+
# # end of the spec run, to help surface which specs are running
|
69
|
+
# # particularly slow.
|
70
|
+
# config.profile_examples = 10
|
71
|
+
#
|
72
|
+
# # Run specs in random order to surface order dependencies. If you find an
|
73
|
+
# # order dependency and want to debug it, you can fix the order by providing
|
74
|
+
# # the seed, which is printed after each run.
|
75
|
+
# # --seed 1234
|
76
|
+
# config.order = :random
|
77
|
+
#
|
78
|
+
# # Seed global randomization in this process using the `--seed` CLI option.
|
79
|
+
# # Setting this allows you to use `--seed` to deterministically reproduce
|
80
|
+
# # test failures related to randomization by passing the same `--seed` value
|
81
|
+
# # as the one that triggered the failure.
|
82
|
+
# Kernel.srand config.seed
|
85
83
|
end
|