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.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -2
  3. data/app/assets/javascripts/admin/blog/posts.js +42 -0
  4. data/app/controllers/admin/post_categories_controller.rb +57 -57
  5. data/app/controllers/admin/posts_controller.rb +110 -101
  6. data/app/controllers/concerns/blog_url_helpers.rb +22 -18
  7. data/app/controllers/concerns/post_view_for_action.rb +11 -0
  8. data/app/controllers/posts_controller.rb +23 -34
  9. data/app/helpers/admin/posts_helper.rb +20 -20
  10. data/app/helpers/blog_helper.rb +21 -21
  11. data/app/models/spud/spud_post_model.rb +43 -51
  12. data/app/models/spud_blog_config.rb +2 -2
  13. data/app/models/spud_post.rb +1 -1
  14. data/app/models/spud_post_categories_post.rb +1 -1
  15. data/app/models/spud_post_category.rb +18 -20
  16. data/app/models/spud_post_site.rb +1 -1
  17. data/app/views/admin/posts/_form.html.erb +4 -3
  18. data/app/views/admin/posts/edit.html.erb +10 -2
  19. data/app/views/admin/posts/new.html.erb +9 -1
  20. data/app/views/admin/posts/show.html.erb +0 -0
  21. data/config/routes.rb +3 -1
  22. data/lib/generators/spud/blog/blog_generator.rb +5 -5
  23. data/lib/generators/spud/blog/random_posts_generator.rb +12 -14
  24. data/lib/generators/spud/blog/views_generator.rb +1 -1
  25. data/lib/spud_blog/configuration.rb +1 -2
  26. data/lib/spud_blog/engine.rb +12 -16
  27. data/lib/spud_blog/version.rb +3 -3
  28. data/lib/tasks/spud_blog_tasks.rake +1 -1
  29. data/lib/tb_blog.rb +2 -2
  30. data/spec/controllers/admin/posts_controller_spec.rb +28 -7
  31. data/spec/controllers/posts_controller_spec.rb +7 -7
  32. data/spec/dummy/config/application.rb +2 -3
  33. data/spec/dummy/config/boot.rb +1 -1
  34. data/spec/dummy/config/environment.rb +2 -2
  35. data/spec/dummy/config/environments/test.rb +3 -3
  36. data/spec/dummy/config/routes.rb +1 -1
  37. data/spec/dummy/config.ru +1 -1
  38. data/spec/dummy/db/migrate/{20120610130206_create_spud_admin_permissions.spud_core.rb → 20161020155425_create_spud_admin_permissions.tb_core.rb} +1 -1
  39. data/spec/dummy/db/migrate/20161020155426_create_spud_users.tb_core.rb +30 -0
  40. 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
  41. 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
  42. data/spec/dummy/db/migrate/{20120610130210_create_spud_user_settings.spud_core.rb → 20161020155429_create_spud_user_settings.tb_core.rb} +1 -1
  43. data/spec/dummy/db/migrate/{20140110180411_create_spud_roles.tb_core.rb → 20161020155430_create_spud_roles.tb_core.rb} +0 -0
  44. data/spec/dummy/db/migrate/{20140110180412_create_spud_permissions.tb_core.rb → 20161020155431_create_spud_permissions.tb_core.rb} +3 -3
  45. data/spec/dummy/db/migrate/{20140110180413_create_spud_role_permissions.tb_core.rb → 20161020155432_create_spud_role_permissions.tb_core.rb} +2 -2
  46. data/spec/dummy/db/migrate/{20140110180414_drop_spud_admin_permissions.tb_core.rb → 20161020155433_drop_spud_admin_permissions.tb_core.rb} +0 -0
  47. 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
  48. data/spec/dummy/db/migrate/{20160215174633_create_tb_redirects.tb_redirects.rb → 20161020155435_create_tb_redirects.tb_redirects.rb} +3 -3
  49. 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
  50. data/spec/dummy/db/migrate/{20140110180418_create_spud_posts.tb_blog.rb → 20161020155437_create_spud_posts.tb_blog.rb} +3 -3
  51. data/spec/dummy/db/migrate/{20140110180419_create_spud_post_categories.tb_blog.rb → 20161020155438_create_spud_post_categories.tb_blog.rb} +4 -4
  52. 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
  53. data/spec/dummy/db/migrate/20161020155440_add_url_to_spud_post_categories.tb_blog.rb +9 -0
  54. 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
  55. data/spec/dummy/db/migrate/{20140110180424_add_meta_to_posts.tb_blog.rb → 20161020155442_add_meta_to_posts.tb_blog.rb} +0 -0
  56. data/spec/dummy/db/migrate/{20140110180426_create_spud_post_sites.tb_blog.rb → 20161020155443_create_spud_post_sites.tb_blog.rb} +3 -3
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. data/spec/dummy/db/migrate/{20150116195007_drop_spud_post_sites.tb_blog.rb → 20161020155450_drop_spud_post_sites.tb_blog.rb} +4 -3
  64. 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
  65. 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
  66. data/spec/dummy/db/schema.rb +106 -118
  67. data/spec/dummy/script/rails +2 -2
  68. data/spec/factories/spud_post_factories.rb +2 -2
  69. data/spec/helpers/admin/posts_helper_spec.rb +1 -1
  70. data/spec/models/spud_post_spec.rb +4 -4
  71. data/spec/rails_helper.rb +5 -5
  72. data/spec/spec_helper.rb +42 -44
  73. metadata +77 -79
  74. data/spec/dummy/db/migrate/20120610130207_create_spud_users.spud_core.rb +0 -30
  75. data/spec/dummy/db/migrate/20140110180415_create_spud_permalinks.tb_permalinks.rb +0 -12
  76. data/spec/dummy/db/migrate/20140110180416_add_site_id_to_spud_permalinks.tb_permalinks.rb +0 -7
  77. data/spec/dummy/db/migrate/20140110180417_modify_site_id_for_spud_permalinks.tb_permalinks.rb +0 -12
  78. data/spec/dummy/db/migrate/20140110180420_create_spud_post_comments.tb_blog.rb +0 -14
  79. data/spec/dummy/db/migrate/20140110180422_add_url_to_spud_post_categories.tb_blog.rb +0 -9
  80. data/spec/dummy/db/migrate/20140110180425_add_comments_counter_to_spud_posts.tb_blog.rb +0 -13
  81. data/spec/dummy/db/migrate/20140110180427_add_spam_fields_to_spud_post_comments.tb_blog.rb +0 -9
  82. data/spec/dummy/db/migrate/20140110180428_add_permalink_to_spud_post_comments.tb_blog.rb +0 -6
  83. data/spec/dummy/db/migrate/20140811161503_add_blog_key_to_spud_post_comments.tb_blog.rb +0 -7
  84. data/spec/dummy/db/migrate/20160216153113_drop_spud_post_comments.rb +0 -29
@@ -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: 20160216153113) 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"
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 "spud_liquid_tags", ["tag_name", "value"], name: "index_spud_liquid_tags_on_tag_name_and_value", using: :btree
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 "spud_permalinks", force: :cascade do |t|
28
- t.string "url_name", limit: 255
29
- t.string "attachment_type", limit: 255
30
- t.integer "attachment_id", limit: 4
31
- t.datetime "created_at"
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 "spud_permalinks", ["attachment_type", "attachment_id"], name: "idx_permalink_attachment", using: :btree
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 "spud_permissions", force: :cascade do |t|
40
- t.string "name", limit: 255, null: false
41
- t.string "tag", limit: 255, null: false
42
- t.datetime "created_at"
43
- t.datetime "updated_at"
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 "spud_permissions", ["tag"], name: "index_spud_permissions_on_tag", unique: true, using: :btree
43
+ add_index 'spud_post_categories', ['url_name'], name: 'index_spud_post_categories_on_url_name', using: :btree
47
44
 
48
- create_table "spud_post_categories", force: :cascade do |t|
49
- t.string "name", limit: 255
50
- t.datetime "created_at"
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 "spud_post_categories", ["url_name"], name: "index_spud_post_categories_on_url_name", using: :btree
56
-
57
- create_table "spud_post_categories_posts", force: :cascade do |t|
58
- t.integer "spud_post_id", limit: 4
59
- t.integer "spud_post_category_id", limit: 4
60
- end
61
-
62
- add_index "spud_post_categories_posts", ["spud_post_category_id"], name: "index_spud_post_categories_posts_on_spud_post_category_id", using: :btree
63
-
64
- create_table "spud_posts", force: :cascade do |t|
65
- t.integer "spud_user_id", limit: 4
66
- t.string "title", limit: 255
67
- t.text "content", limit: 65535
68
- t.boolean "comments_enabled", default: false
69
- t.boolean "visible", default: true
70
- t.datetime "published_at"
71
- t.datetime "created_at"
72
- t.datetime "updated_at"
73
- t.string "url_name", limit: 255
74
- t.boolean "is_news", default: false
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 "spud_posts", ["blog_key"], name: "index_spud_posts_on_blog_key", using: :btree
85
- add_index "spud_posts", ["identifier"], name: "index_spud_posts_on_identifier", unique: true, using: :btree
86
- add_index "spud_posts", ["is_news"], name: "index_spud_posts_on_is_news", using: :btree
87
- add_index "spud_posts", ["spud_user_id"], name: "index_spud_posts_on_spud_user_id", using: :btree
88
- add_index "spud_posts", ["url_name"], name: "index_spud_posts_on_url_name", using: :btree
89
- add_index "spud_posts", ["visible"], name: "index_spud_posts_on_visible", using: :btree
90
-
91
- create_table "spud_role_permissions", force: :cascade do |t|
92
- t.integer "spud_role_id", limit: 4, null: false
93
- t.string "spud_permission_tag", limit: 255, null: false
94
- t.datetime "created_at"
95
- t.datetime "updated_at"
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 "spud_role_permissions", ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag", using: :btree
99
- add_index "spud_role_permissions", ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id", using: :btree
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 "spud_roles", force: :cascade do |t|
102
- t.string "name", limit: 255
103
- t.datetime "created_at"
104
- t.datetime "updated_at"
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 "spud_user_settings", force: :cascade do |t|
108
- t.integer "spud_user_id", limit: 4
109
- t.string "key", limit: 255
110
- t.string "value", limit: 255
111
- t.datetime "created_at"
112
- t.datetime "updated_at"
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 "spud_users", force: :cascade do |t|
116
- t.string "first_name", limit: 255
117
- t.string "last_name", limit: 255
118
- t.boolean "super_admin"
119
- t.string "login", limit: 255, null: false
120
- t.string "email", limit: 255, null: false
121
- t.string "crypted_password", limit: 255, null: false
122
- t.string "password_salt", limit: 255, null: false
123
- t.string "persistence_token", limit: 255, null: false
124
- t.string "single_access_token", limit: 255, null: false
125
- t.string "perishable_token", limit: 255, null: false
126
- t.integer "login_count", limit: 4, default: 0, null: false
127
- t.integer "failed_login_count", limit: 4, default: 0, null: false
128
- t.datetime "last_request_at"
129
- t.datetime "current_login_at"
130
- t.datetime "last_login_at"
131
- t.string "current_login_ip", limit: 255
132
- t.string "last_login_ip", limit: 255
133
- t.datetime "created_at"
134
- t.datetime "updated_at"
135
- t.string "time_zone", limit: 255
136
- t.integer "spud_role_id", limit: 4
137
- t.boolean "requires_password_change", default: false
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 "spud_users", ["email"], name: "index_spud_users_on_email", using: :btree
141
- add_index "spud_users", ["login"], name: "index_spud_users_on_login", using: :btree
142
- add_index "spud_users", ["spud_role_id"], name: "index_spud_users_on_spud_role_id", using: :btree
143
-
144
- create_table "tb_redirects", force: :cascade do |t|
145
- t.string "owner_type", limit: 255
146
- t.integer "owner_id", limit: 4
147
- t.string "source", limit: 255, null: false
148
- t.string "destination", limit: 255, null: false
149
- t.string "created_by", limit: 255
150
- t.datetime "created_at", null: false
151
- t.datetime "updated_at", null: false
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 "tb_redirects", ["owner_type", "owner_id"], name: "index_tb_redirects_on_owner_type_and_owner_id", using: :btree
155
- add_index "tb_redirects", ["source"], name: "index_tb_redirects_on_source", unique: true, using: :btree
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
@@ -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', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
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 "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."
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 "HTML"
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("testblog.disqus.com")
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, :type => :model do
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("%b %d, %Y"))
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, :identifier => nil)
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["RAILS_ENV"] ||= 'test'
2
+ ENV['RAILS_ENV'] ||= 'test'
3
3
 
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
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
- =begin
44
- # These two settings work together to allow you to limit a spec run
45
- # to individual examples or groups you care about by tagging them with
46
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
47
- # get run.
48
- config.filter_run :focus
49
- config.run_all_when_everything_filtered = true
50
-
51
- # Limits the available syntax to the non-monkey patched syntax that is recommended.
52
- # For more details, see:
53
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
54
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
55
- # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
56
- config.disable_monkey_patching!
57
-
58
- # Many RSpec users commonly either run the entire suite or an individual
59
- # file, and it's useful to allow more verbose output when running an
60
- # individual spec file.
61
- if config.files_to_run.one?
62
- # Use the documentation formatter for detailed output,
63
- # unless a formatter has already been configured
64
- # (e.g. via a command-line flag).
65
- config.default_formatter = 'doc'
66
- end
67
-
68
- # Print the 10 slowest examples and example groups at the
69
- # end of the spec run, to help surface which specs are running
70
- # particularly slow.
71
- config.profile_examples = 10
72
-
73
- # Run specs in random order to surface order dependencies. If you find an
74
- # order dependency and want to debug it, you can fix the order by providing
75
- # the seed, which is printed after each run.
76
- # --seed 1234
77
- config.order = :random
78
-
79
- # Seed global randomization in this process using the `--seed` CLI option.
80
- # Setting this allows you to use `--seed` to deterministically reproduce
81
- # test failures related to randomization by passing the same `--seed` value
82
- # as the one that triggered the failure.
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