storytime 2.1.6 → 2.1.7
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.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +54 -0
- data/.gitignore +2 -1
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/Gemfile +5 -3
- data/Gemfile.lock +414 -425
- data/Guardfile +1 -1
- data/app/assets/fonts/storytime-icons.eot +0 -0
- data/app/assets/fonts/storytime-icons.svg +23 -0
- data/app/assets/fonts/storytime-icons.ttf +0 -0
- data/app/assets/fonts/storytime-icons.woff +0 -0
- data/app/assets/javascripts/storytime/application.js +1 -8
- data/app/assets/javascripts/storytime/off_canvas.coffee +16 -0
- data/app/assets/javascripts/storytime/wysiwyg.js.coffee +9 -7
- data/app/assets/stylesheets/storytime/_buttons.scss +33 -0
- data/app/assets/stylesheets/storytime/_list-group.scss +1 -1
- data/app/assets/stylesheets/storytime/application.scss +14 -2
- data/app/assets/stylesheets/storytime/icons.scss +5 -5
- data/app/assets/stylesheets/storytime/leather/_buttons.scss +31 -0
- data/app/assets/stylesheets/storytime/leather/_devise.scss +72 -0
- data/app/assets/stylesheets/storytime/leather/_grid.scss +19 -0
- data/app/assets/stylesheets/storytime/leather/_list_groups.scss +33 -0
- data/app/assets/stylesheets/storytime/leather/_nav_menus.scss +125 -0
- data/app/assets/stylesheets/storytime/leather/_navbar_transparent.scss +23 -0
- data/app/assets/stylesheets/storytime/leather/_off_canvas.scss +109 -0
- data/app/assets/stylesheets/storytime/leather/_scroll_panels.scss +85 -0
- data/app/assets/stylesheets/storytime/leather/_toggle_columns.scss +23 -0
- data/app/assets/stylesheets/storytime/leather/_typography.scss +12 -0
- data/app/assets/stylesheets/storytime/leather/_utilities.scss +54 -0
- data/app/assets/stylesheets/storytime/leather/_variables.scss +8 -0
- data/app/assets/stylesheets/storytime/posts.scss +9 -1
- data/app/controllers/storytime/application_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/blog_posts_controller.rb +5 -3
- data/app/controllers/storytime/dashboard/blogs_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/media_controller.rb +4 -4
- data/app/controllers/storytime/dashboard/memberships_controller.rb +1 -1
- data/app/controllers/storytime/dashboard/pages_controller.rb +26 -6
- data/app/controllers/storytime/dashboard/posts_controller.rb +30 -5
- data/app/controllers/storytime/dashboard/subscriptions_controller.rb +1 -1
- data/app/controllers/storytime/pages_controller.rb +31 -1
- data/app/controllers/storytime/posts_controller.rb +1 -1
- data/app/controllers/storytime/subscriptions_controller.rb +5 -1
- data/app/helpers/storytime/application_helper.rb +0 -4
- data/app/models/concerns/storytime/post_featured_images.rb +2 -2
- data/app/models/concerns/storytime/post_partial_inheritance.rb +2 -2
- data/app/models/storytime/autosave.rb +1 -1
- data/app/models/storytime/comment.rb +1 -1
- data/app/models/storytime/media.rb +1 -1
- data/app/models/storytime/membership.rb +2 -2
- data/app/models/storytime/post.rb +7 -3
- data/app/models/storytime/site.rb +4 -6
- data/app/models/storytime/snippet.rb +12 -1
- data/app/models/storytime/subscription.rb +2 -2
- data/app/models/storytime/version.rb +1 -1
- data/app/policies/storytime/post_policy.rb +1 -1
- data/app/views/storytime/dashboard/_navigation.html.erb +0 -9
- data/app/views/storytime/dashboard/blog_posts/_form.html.erb +5 -1
- data/app/views/storytime/dashboard/blogs/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/blogs/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/blogs/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/media/_gallery.html.erb +1 -1
- data/app/views/storytime/dashboard/media/_modal.html.erb +2 -2
- data/app/views/storytime/dashboard/media/show.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/_edit.html.erb +1 -1
- data/app/views/storytime/dashboard/memberships/_index.html.erb +3 -3
- data/app/views/storytime/dashboard/memberships/_new.html.erb +1 -1
- data/app/views/storytime/dashboard/memberships/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/memberships/save.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/pages/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_directory.html.erb +18 -0
- data/app/views/storytime/dashboard/posts/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_list.html.erb +2 -26
- data/app/views/storytime/dashboard/posts/_new_button.html.erb +1 -1
- data/app/views/storytime/dashboard/posts/_post.html.erb +28 -0
- data/app/views/storytime/dashboard/posts/_sorts.html.erb +21 -0
- data/app/views/storytime/dashboard/posts/index.html.erb +5 -3
- data/app/views/storytime/dashboard/roles/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/roles/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/sites/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/sites/site.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/_index.html.erb +1 -1
- data/app/views/storytime/dashboard/snippets/edit.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/snippets/new.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/subscriptions/_form.html.erb +1 -1
- data/app/views/storytime/dashboard/subscriptions/_index.html.erb +2 -2
- data/app/views/storytime/dashboard/subscriptions/form.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/subscriptions/index.json.jbuilder +1 -1
- data/app/views/storytime/dashboard/versions/_versions_info.html.erb +1 -1
- data/app/views/storytime/posts/show.html.erb +6 -0
- data/app/views/storytime/sites/_google_analytics_code.html.erb +5 -8
- data/config/initializers/assets.rb +2 -1
- data/config/initializers/friendly_id.rb +1 -1
- data/config/initializers/url_for_patch.rb +19 -8
- data/config/locales/devise.zh-CN.yml +59 -0
- data/config/locales/kaminari.zh-CN.yml +17 -0
- data/config/locales/simple_form.zh-CN.yml +26 -0
- data/config/locales/zh-CN.yml +141 -0
- data/config/routes.rb +2 -4
- data/db/migrate/20140501174341_create_storytime_posts.rb +1 -1
- data/db/migrate/20140509191309_create_friendly_id_slugs.rb +1 -1
- data/db/migrate/20140511200849_create_storytime_media.rb +1 -1
- data/db/migrate/20140513161233_create_storytime_sites.rb +1 -1
- data/db/migrate/20140514200234_create_storytime_tags.rb +1 -1
- data/db/migrate/20140514200304_create_storytime_taggings.rb +1 -1
- data/db/migrate/20140516141252_create_storytime_versions.rb +1 -1
- data/db/migrate/20140521190606_create_storytime_roles.rb +1 -1
- data/db/migrate/20140521191048_add_storytime_role_id_to_users.rb +1 -1
- data/db/migrate/20140521191728_create_storytime_permissions.rb +1 -1
- data/db/migrate/20140521191744_create_storytime_actions.rb +1 -1
- data/db/migrate/20140813014447_create_storytime_comments.rb +1 -1
- data/db/migrate/20140813130534_add_storytime_name_to_users.rb +1 -1
- data/db/migrate/20140916183056_create_storytime_autosaves.rb +1 -1
- data/db/migrate/20141020213343_add_secondary_media_id_to_storytime_post.rb +1 -1
- data/db/migrate/20141021073356_create_storytime_snippets.rb +1 -1
- data/db/migrate/20141111164439_create_storytime_subscriptions.rb +1 -1
- data/db/migrate/20150122200805_add_title_and_content_index_to_storytime_post.rb +1 -1
- data/db/migrate/20150128185746_seed_new_actions_and_permissions.rb +1 -1
- data/db/migrate/20150129215308_add_site_id_to_storytime_subscription.rb +1 -1
- data/db/migrate/20150206201847_add_site_id_to_storytime_post.rb +1 -1
- data/db/migrate/20150206201919_add_site_id_to_storytime_snippet.rb +1 -1
- data/db/migrate/20150206201931_add_site_id_to_storytime_tag.rb +1 -1
- data/db/migrate/20150206205256_add_notification_fields_to_storytime_post.rb +1 -1
- data/db/migrate/20150216211257_add_subdomain_to_storytime_sites.rb +1 -1
- data/db/migrate/20150216225045_add_site_to_storytime_media.rb +1 -1
- data/db/migrate/20150219210528_remove_root_page_content_from_storytime_sites.rb +1 -1
- data/db/migrate/20150220184902_add_blog_id_to_posts.rb +1 -1
- data/db/migrate/20150224192138_add_homepage_path_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224193151_add_subscription_email_from_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224193551_add_layout_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224194559_add_disqus_forum_shortname_to_storytime_sites.rb +1 -1
- data/db/migrate/20150224212453_remove_homepage_path_from_storytime_sites.rb +1 -1
- data/db/migrate/20150225143516_add_site_id_to_storytime_autosaves.rb +1 -1
- data/db/migrate/20150225143826_add_site_id_to_storytime_comments.rb +1 -1
- data/db/migrate/20150225145119_add_site_id_to_storytime_versions.rb +1 -1
- data/db/migrate/20150225145316_add_site_id_to_storytime_taggings.rb +1 -1
- data/db/migrate/20150225145608_update_storytime_site_id_columns.rb +1 -1
- data/db/migrate/20150225164232_add_site_id_to_storytime_permissions.rb +1 -1
- data/db/migrate/20150225212917_create_storytime_memberships.rb +1 -1
- data/db/migrate/20150225213535_create_memberships_for_storytime_users.rb +1 -1
- data/db/migrate/20150226201739_add_custom_domain_to_storytime_sites.rb +1 -1
- data/db/migrate/20150302171500_add_site_id_to_storytime_media.rb +1 -1
- data/db/migrate/20150302171722_set_site_layout.rb +1 -1
- data/db/migrate/20150302185138_remove_storytime_role_id_from_users.rb +1 -1
- data/db/migrate/20150302192525_transfer_posts_to_blogs.rb +1 -1
- data/db/migrate/20150302192759_seed_permissions.rb +1 -1
- data/db/migrate/20150331162329_add_discourse_name_to_storytime_sites.rb +1 -1
- data/db/migrate/20150402161427_remove_subdomain_from_storytime_site.rb +1 -1
- data/db/migrate/20150520181115_create_storytime_navigations.rb +1 -1
- data/db/migrate/20150520185227_create_storytime_links.rb +1 -1
- data/db/migrate/20150520190700_add_position_to_storytime_links.rb +1 -1
- data/db/migrate/20150529192058_add_url_to_storytime_links.rb +1 -1
- data/db/migrate/20260408001637_add_canonical_url_to_storytime_posts.rb +5 -0
- data/db/migrate/20260701000000_sanitize_existing_storytime_snippets.rb +22 -0
- data/lib/storytime/cli/install.rb +2 -20
- data/lib/storytime/concerns/action_controller_extension.rb +36 -0
- data/lib/storytime/constraints/page_constraint.rb +8 -2
- data/lib/storytime/engine.rb +3 -5
- data/lib/storytime/migrators/v1.rb +3 -3
- data/lib/storytime/post_notifier.rb +1 -1
- data/lib/storytime/post_url_handler.rb +18 -5
- data/lib/storytime/storytime_helpers.rb +4 -0
- data/lib/storytime/version.rb +1 -1
- data/lib/storytime.rb +1 -1
- data/spec/controllers/dashboard_controller_spec.rb +5 -6
- data/spec/dummy/app/assets/config/manifest.js +3 -0
- data/spec/dummy/config/database.yml +3 -3
- data/spec/dummy/config/initializers/devise.rb +1 -1
- data/spec/dummy/db/migrate/20140530185250_devise_create_users.rb +1 -1
- data/spec/dummy/db/migrate/20150127172846_create_widgets.rb +1 -1
- data/spec/dummy/db/migrate/20150206203824_add_video_url_to_storytime_posts.rb +1 -1
- data/spec/dummy/db/schema.rb +226 -244
- data/spec/factories/action_factories.rb +3 -3
- data/spec/factories/comment_factories.rb +1 -1
- data/spec/factories/media_factories.rb +1 -1
- data/spec/factories/membership_factories.rb +1 -1
- data/spec/factories/navigation_factories.rb +3 -3
- data/spec/factories/permission_factories.rb +1 -1
- data/spec/factories/post_factories.rb +2 -2
- data/spec/factories/role_factories.rb +11 -11
- data/spec/factories/site_factories.rb +3 -3
- data/spec/factories/snippet_factories.rb +1 -1
- data/spec/factories/subscription_factories.rb +1 -1
- data/spec/factories/user_factories.rb +2 -2
- data/spec/factories/widget_factories.rb +2 -2
- data/spec/features/blogs_spec.rb +7 -7
- data/spec/features/comments_spec.rb +11 -11
- data/spec/features/dashboard/media_spec.rb +17 -11
- data/spec/features/dashboard/memberships_spec.rb +13 -19
- data/spec/features/dashboard/navigations_spec.rb +1 -1
- data/spec/features/dashboard/pages_spec.rb +8 -8
- data/spec/features/dashboard/posts_spec.rb +19 -19
- data/spec/features/dashboard/sites_spec.rb +1 -1
- data/spec/features/dashboard/snippets_spec.rb +3 -3
- data/spec/features/dashboard/subscription_spec.rb +2 -2
- data/spec/features/pages_spec.rb +3 -3
- data/spec/features/posts_spec.rb +2 -2
- data/spec/features/subscription_spec.rb +3 -3
- data/spec/importers/wordpress_spec.rb +1 -1
- data/spec/lib/mysql_fulltext_search_adapter_spec.rb +3 -3
- data/spec/lib/mysql_search_adapter_spec.rb +3 -3
- data/spec/lib/postgres_search_adapter_spec.rb +3 -3
- data/spec/lib/sqlite3_search_adapter_spec.rb +3 -3
- data/spec/lib/storytime/constraints/page_constraint_spec.rb +40 -0
- data/spec/lib/storytime_helpers_spec.rb +2 -2
- data/spec/models/navigation_spec.rb +3 -3
- data/spec/models/post_spec.rb +29 -29
- data/spec/models/snippet_spec.rb +31 -0
- data/spec/models/subscription_spec.rb +4 -4
- data/spec/models/tagging_spec.rb +14 -14
- data/spec/models/version_spec.rb +29 -29
- data/spec/policies/comment_policy_spec.rb +11 -11
- data/spec/policies/post_policy_spec.rb +13 -13
- data/spec/requests/pages_spec.rb +37 -0
- data/spec/requests/routings_spec.rb +14 -15
- data/spec/spec_helper.rb +8 -15
- data/spec/support/domains.rb +2 -2
- data/spec/support/feature_macros.rb +5 -5
- data/spec/support/pundit_matcher.rb +3 -3
- data/storytime.gemspec +15 -20
- data/vendor/assets/javascripts/codemirror/addons/edit/closebrackets.js +195 -0
- data/vendor/assets/javascripts/codemirror/addons/edit/closetag.js +169 -0
- data/vendor/assets/javascripts/codemirror/addons/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/codemirror.js +8922 -0
- data/vendor/assets/javascripts/medium-editor.min.js +3 -3
- data/vendor/assets/stylesheets/codemirror/themes/solarized.css +169 -0
- data/vendor/assets/stylesheets/codemirror.css +347 -0
- metadata +94 -134
- data/config/initializers/storytime_admin.rb +0 -5
- data/config/spring.rb +0 -1
- data/spec/dummy/app/controllers/storytime_admin/widgets_controller.rb +0 -5
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
data/spec/features/blogs_spec.rb
CHANGED
|
@@ -2,20 +2,20 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Blogs", type: :feature do
|
|
4
4
|
before do
|
|
5
|
-
setup_site(
|
|
5
|
+
setup_site(FactoryBot.create(:admin))
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "lists posts belonging to that blog" do
|
|
9
|
-
3.times{
|
|
10
|
-
other_blog_post =
|
|
11
|
-
static_page =
|
|
9
|
+
3.times{ FactoryBot.create(:post, blog: @current_site.blogs.first, site: @current_site) }
|
|
10
|
+
other_blog_post = FactoryBot.create(:post, site: @current_site)
|
|
11
|
+
static_page = FactoryBot.create(:page, site: @current_site)
|
|
12
12
|
visit url_for([@current_site.blogs.first, only_path: true])
|
|
13
13
|
|
|
14
14
|
within ".post-list" do
|
|
15
15
|
@current_site.blogs.first.posts.each do |p|
|
|
16
|
-
page.
|
|
17
|
-
page.
|
|
18
|
-
page.
|
|
16
|
+
expect(page).to have_content(p.title)
|
|
17
|
+
expect(page).to have_content(p.excerpt)
|
|
18
|
+
expect(page).to_not have_content(p.content)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
expect(page).not_to have_content(static_page.title)
|
|
@@ -7,22 +7,22 @@ describe "Comments", type: :feature do
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
it "lists comments on a post" do
|
|
10
|
-
post =
|
|
11
|
-
3.times{
|
|
12
|
-
other_post_comment =
|
|
10
|
+
post = FactoryBot.create(:post, site: @current_site, blog: @current_site.blogs.first)
|
|
11
|
+
3.times{ FactoryBot.create(:comment, post: post, site: @current_site) }
|
|
12
|
+
other_post_comment = FactoryBot.create(:comment, site: @current_site)
|
|
13
13
|
|
|
14
14
|
visit url_for([post, only_path: true])
|
|
15
15
|
|
|
16
16
|
post.comments.each do |c|
|
|
17
|
-
page.
|
|
18
|
-
page.
|
|
17
|
+
expect(page).to have_content(c.content)
|
|
18
|
+
expect(page).to have_content(c.user.storytime_name)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
page.
|
|
21
|
+
expect(page).to_not have_content(other_post_comment.content)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "creates a comment" do
|
|
25
|
-
post =
|
|
25
|
+
post = FactoryBot.create(:post, site: @current_site, blog: @current_site.blogs.first)
|
|
26
26
|
comment_count = post.comments.count
|
|
27
27
|
|
|
28
28
|
visit url_for([post, only_path: true])
|
|
@@ -38,9 +38,9 @@ describe "Comments", type: :feature do
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
it "deletes a comment", js: true do
|
|
41
|
-
post =
|
|
42
|
-
other_persons_comment =
|
|
43
|
-
comment_to_delete =
|
|
41
|
+
post = FactoryBot.create(:post, site: @current_site, blog: @current_site.blogs.first)
|
|
42
|
+
other_persons_comment = FactoryBot.create(:comment, post: post, site: @current_site)
|
|
43
|
+
comment_to_delete = FactoryBot.create(:comment, post: post, user: current_user, site: @current_site)
|
|
44
44
|
|
|
45
45
|
visit url_for([post, only_path: true])
|
|
46
46
|
|
|
@@ -51,7 +51,7 @@ describe "Comments", type: :feature do
|
|
|
51
51
|
|
|
52
52
|
expect(page).to_not have_content(comment_to_delete.content)
|
|
53
53
|
|
|
54
|
-
expect{ comment_to_delete.reload }.to raise_error
|
|
54
|
+
expect{ comment_to_delete.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
end
|
|
@@ -8,34 +8,40 @@ describe "In the dashboard, Media", type: :feature do
|
|
|
8
8
|
it "creates media", js: true do
|
|
9
9
|
visit dashboard_media_index_path
|
|
10
10
|
|
|
11
|
-
attach_file
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
# Use find + set instead of attach_file so Cuprite targets the
|
|
12
|
+
# current file input after jQuery fileupload replaces the original.
|
|
13
|
+
input = find("input[type='file'][name='media[file]']", visible: :all)
|
|
14
|
+
input.set(File.expand_path("./spec/support/images/success-kid.jpg"))
|
|
15
|
+
|
|
16
|
+
within("#media_gallery") do
|
|
17
|
+
expect(page).to have_css("img", wait: 10)
|
|
18
|
+
expect(find("img")['src']).to have_content('success-kid.jpg')
|
|
19
|
+
end
|
|
14
20
|
end
|
|
15
21
|
|
|
16
22
|
it "shows a gallery of the user's images" do
|
|
17
|
-
m1 =
|
|
18
|
-
m2 =
|
|
23
|
+
m1 = FactoryBot.create(:media, site: @current_site)
|
|
24
|
+
m2 = FactoryBot.create(:media, site: @current_site)
|
|
19
25
|
|
|
20
26
|
visit dashboard_media_index_path
|
|
21
27
|
|
|
22
|
-
page.
|
|
23
|
-
page.
|
|
28
|
+
expect(page).to have_image(m1.file_url(:thumb))
|
|
29
|
+
expect(page).to have_image(m2.file_url(:thumb))
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
it "deletes an image", js: true do
|
|
27
|
-
image =
|
|
33
|
+
image = FactoryBot.create(:media, site: @current_site)
|
|
28
34
|
|
|
29
35
|
visit dashboard_media_index_path
|
|
30
|
-
page.
|
|
36
|
+
expect(page).to have_image(image.file_url(:thumb))
|
|
31
37
|
|
|
32
38
|
click_link "delete_media_#{image.id}"
|
|
33
39
|
|
|
34
|
-
page.
|
|
40
|
+
expect(page).to_not have_image(image)
|
|
35
41
|
end
|
|
36
42
|
|
|
37
43
|
it "inserts media into post", js: true do
|
|
38
|
-
media =
|
|
44
|
+
media = FactoryBot.create(:media, site: @current_site)
|
|
39
45
|
|
|
40
46
|
visit url_for([:new, :dashboard, @current_site.blogs.first, :blog_post, only_path: true])
|
|
41
47
|
|
|
@@ -5,8 +5,8 @@ describe "In the dashboard, Users", type: :feature do
|
|
|
5
5
|
before{ login_admin }
|
|
6
6
|
|
|
7
7
|
it "provides links to all the sites where the user has a membership", js: true do
|
|
8
|
-
other_site =
|
|
9
|
-
membership =
|
|
8
|
+
other_site = FactoryBot.create(:site)
|
|
9
|
+
membership = FactoryBot.create(:membership, user: @current_user, site: other_site)
|
|
10
10
|
|
|
11
11
|
visit storytime.dashboard_path
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ describe "In the dashboard, Users", type: :feature do
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it "lists users for a site", js: true do
|
|
20
|
-
|
|
20
|
+
FactoryBot.create_list(:user, 3)
|
|
21
21
|
|
|
22
22
|
Storytime.user_class.all.each do |user|
|
|
23
23
|
user.storytime_memberships.create(site: @current_site, storytime_role: Storytime::Role.find_by(name: "writer"))
|
|
@@ -33,7 +33,7 @@ describe "In the dashboard, Users", type: :feature do
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it "deletes a user from the site", js: true do
|
|
36
|
-
user =
|
|
36
|
+
user = FactoryBot.create(:user)
|
|
37
37
|
membership = user.storytime_memberships.create(site: @current_site, storytime_role: Storytime::Role.find_by(name: "writer"))
|
|
38
38
|
|
|
39
39
|
user_count = Storytime.user_class.count
|
|
@@ -54,26 +54,23 @@ describe "In the dashboard, Users", type: :feature do
|
|
|
54
54
|
expect(Storytime::Membership.count).to eq(membership_count-1)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
it "edits own profile", js: true do
|
|
58
|
-
u = User.last
|
|
59
57
|
|
|
58
|
+
it "edits own profile", js: true do
|
|
60
59
|
visit storytime.dashboard_path
|
|
61
60
|
click_link "utility-menu-toggle"
|
|
62
61
|
click_link "profile-link"
|
|
63
62
|
fill_in "membership_user_attributes_email", with: "new_email@example.com"
|
|
63
|
+
|
|
64
64
|
click_button "Save"
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
storytime_name_field = find_field("membership_user_attributes_storytime_name").value
|
|
68
|
-
storytime_email_field = find_field("membership_user_attributes_email").value
|
|
66
|
+
expect(page).to have_content("Your changes were saved successfully")
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
end
|
|
68
|
+
current_user.reload
|
|
69
|
+
expect(current_user.email).to eq("new_email@example.com")
|
|
73
70
|
end
|
|
74
71
|
|
|
75
72
|
it "edits another user's profile", js: true do
|
|
76
|
-
|
|
73
|
+
FactoryBot.create :membership, site: @current_site
|
|
77
74
|
u = User.last
|
|
78
75
|
|
|
79
76
|
visit storytime.dashboard_path
|
|
@@ -85,13 +82,10 @@ describe "In the dashboard, Users", type: :feature do
|
|
|
85
82
|
fill_in "membership_user_attributes_email", with: "change_email@example.com"
|
|
86
83
|
click_button "Save"
|
|
87
84
|
|
|
88
|
-
|
|
89
|
-
storytime_name_field = find_field("membership_user_attributes_storytime_name").value
|
|
90
|
-
storytime_email_field = find_field("membership_user_attributes_email").value
|
|
85
|
+
expect(page).to have_content("Your changes were saved successfully")
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
end
|
|
87
|
+
u.reload
|
|
88
|
+
expect(u.email).to eq("change_email@example.com")
|
|
95
89
|
end
|
|
96
90
|
|
|
97
91
|
it "creates a user", js: true do
|
|
@@ -21,7 +21,7 @@ describe "In the dashboard, Navigations", type: :feature do
|
|
|
21
21
|
|
|
22
22
|
it "updates a navigation list" do
|
|
23
23
|
Storytime::Site.current_id = current_site.id
|
|
24
|
-
nav =
|
|
24
|
+
nav = FactoryBot.create(:navigation, site_id: current_site.id)
|
|
25
25
|
visit edit_dashboard_navigation_path(nav)
|
|
26
26
|
|
|
27
27
|
fill_in "navigation_name", with: "New Name"
|
|
@@ -7,11 +7,11 @@ describe "In the dashboard, Pages", type: :feature do
|
|
|
7
7
|
|
|
8
8
|
describe "index" do
|
|
9
9
|
before do
|
|
10
|
-
3.times{
|
|
11
|
-
3.times{
|
|
10
|
+
3.times{ FactoryBot.create(:page, site: current_site) }
|
|
11
|
+
3.times{ FactoryBot.create(:page, published_at: nil, site: current_site) }
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
let!(:other_site_page){
|
|
14
|
+
let!(:other_site_page){ FactoryBot.create(:page) }
|
|
15
15
|
|
|
16
16
|
it "lists all pages" do
|
|
17
17
|
visit dashboard_pages_path
|
|
@@ -65,7 +65,7 @@ describe "In the dashboard, Pages", type: :feature do
|
|
|
65
65
|
|
|
66
66
|
pg = Storytime::Page.last
|
|
67
67
|
expect(pg.title).to eq("The Page")
|
|
68
|
-
expect(pg.draft_content).to
|
|
68
|
+
expect(pg.draft_content).to include("The content of my page")
|
|
69
69
|
expect(pg.user).to eq(current_user)
|
|
70
70
|
expect(pg.site).to eq(current_site)
|
|
71
71
|
expect(pg.type).to eq("Storytime::Page")
|
|
@@ -74,7 +74,7 @@ describe "In the dashboard, Pages", type: :feature do
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
it "updates a page", js: true do
|
|
77
|
-
pg =
|
|
77
|
+
pg = FactoryBot.create(:page, site: current_site, published_at: nil)
|
|
78
78
|
original_creator = pg.user
|
|
79
79
|
page_count = Storytime::Page.count
|
|
80
80
|
|
|
@@ -90,14 +90,14 @@ describe "In the dashboard, Pages", type: :feature do
|
|
|
90
90
|
|
|
91
91
|
pg = Storytime::Page.last
|
|
92
92
|
expect(pg.title).to eq("The Story")
|
|
93
|
-
expect(pg.draft_content).to
|
|
93
|
+
expect(pg.draft_content).to include("It was a dark and stormy night...")
|
|
94
94
|
expect(pg.user).to eq(original_creator)
|
|
95
95
|
expect(pg.type).to eq("Storytime::Page")
|
|
96
96
|
expect(pg).to_not be_published
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
it "deletes a page", js: true do
|
|
100
|
-
storytime_page =
|
|
100
|
+
storytime_page = FactoryBot.create(:page, site: current_site)
|
|
101
101
|
page_count = Storytime::Page.count
|
|
102
102
|
|
|
103
103
|
visit edit_dashboard_page_path(storytime_page)
|
|
@@ -106,7 +106,7 @@ describe "In the dashboard, Pages", type: :feature do
|
|
|
106
106
|
click_link "Delete"
|
|
107
107
|
|
|
108
108
|
expect(page).to_not have_content(storytime_page.title)
|
|
109
|
-
expect { storytime_page.reload }.to raise_error
|
|
109
|
+
expect { storytime_page.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
|
110
110
|
expect(Storytime::Page.count).to eq(page_count - 1)
|
|
111
111
|
end
|
|
112
112
|
|
|
@@ -7,9 +7,9 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
7
7
|
|
|
8
8
|
it "lists all posts" do
|
|
9
9
|
blog = @current_site.blogs.first
|
|
10
|
-
|
|
11
|
-
2.times{
|
|
12
|
-
static_page =
|
|
10
|
+
FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil)
|
|
11
|
+
2.times{ FactoryBot.create(:post, blog: blog, site: @current_site, published_at: 1.hours.ago) }
|
|
12
|
+
static_page = FactoryBot.create(:page)
|
|
13
13
|
|
|
14
14
|
visit url_for([storytime, :dashboard, blog, :blog_page_post_index, only_path: true])
|
|
15
15
|
|
|
@@ -24,10 +24,10 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
24
24
|
|
|
25
25
|
it "lists draft posts" do
|
|
26
26
|
blog = @current_site.blogs.first
|
|
27
|
-
3.times{
|
|
28
|
-
3.times{
|
|
29
|
-
|
|
30
|
-
static_page =
|
|
27
|
+
3.times{ FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil) }
|
|
28
|
+
3.times{ FactoryBot.create(:post, blog: blog, site: @current_site, published_at: 2.hours.ago) }
|
|
29
|
+
FactoryBot.create(:post)
|
|
30
|
+
static_page = FactoryBot.create(:page)
|
|
31
31
|
|
|
32
32
|
visit url_for([storytime, :dashboard, blog, :blog_page_post_index, draft: true, only_path: true])
|
|
33
33
|
|
|
@@ -43,9 +43,9 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
43
43
|
|
|
44
44
|
it "lists published posts" do
|
|
45
45
|
blog = @current_site.blogs.first
|
|
46
|
-
|
|
47
|
-
2.times{
|
|
48
|
-
static_page =
|
|
46
|
+
FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil)
|
|
47
|
+
2.times{ FactoryBot.create(:post, blog: blog, site: @current_site, published_at: 3.hours.ago) }
|
|
48
|
+
static_page = FactoryBot.create(:page)
|
|
49
49
|
|
|
50
50
|
visit url_for([storytime, :dashboard, blog, :blog_page_post_index, published: true, only_path: true])
|
|
51
51
|
|
|
@@ -61,7 +61,7 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
61
61
|
|
|
62
62
|
it "creates a post", js: true do
|
|
63
63
|
post_count = Storytime::BlogPost.count
|
|
64
|
-
media =
|
|
64
|
+
media = FactoryBot.create(:media)
|
|
65
65
|
Rails.logger.warn "==> STARTING CREATE POST"
|
|
66
66
|
visit url_for([:new, :dashboard, @current_site.blogs.first, :blog_post, only_path: true])
|
|
67
67
|
|
|
@@ -80,7 +80,7 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
80
80
|
|
|
81
81
|
post = Storytime::BlogPost.last
|
|
82
82
|
expect(post.title).to eq("The Story")
|
|
83
|
-
expect(post.draft_content).to
|
|
83
|
+
expect(post.draft_content).to include("It was a dark and stormy night...")
|
|
84
84
|
expect(post.user).to eq(current_user)
|
|
85
85
|
expect(post.type).to eq("Storytime::BlogPost")
|
|
86
86
|
expect(post.featured_media).to eq(media)
|
|
@@ -103,7 +103,7 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
103
103
|
|
|
104
104
|
post = Storytime::BlogPost.last
|
|
105
105
|
expect(post.title).to eq("Snow Crash")
|
|
106
|
-
expect(post.draft_content).to
|
|
106
|
+
expect(post.draft_content).to include("It was a dark and stormy night...")
|
|
107
107
|
expect(post.user).to eq(current_user)
|
|
108
108
|
expect(post.type).to eq("Storytime::BlogPost")
|
|
109
109
|
expect(post).to_not be_published
|
|
@@ -111,7 +111,7 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
111
111
|
|
|
112
112
|
it "autosaves a post when editing", js: true do
|
|
113
113
|
blog = @current_site.blogs.first
|
|
114
|
-
post =
|
|
114
|
+
post = FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil,
|
|
115
115
|
title: "A Scandal in Bohemia",
|
|
116
116
|
draft_content: "To Sherlock Holmes she was always the woman.")
|
|
117
117
|
|
|
@@ -134,13 +134,13 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
134
134
|
|
|
135
135
|
post.reload
|
|
136
136
|
expect(post.autosave).not_to be_nil
|
|
137
|
-
expect(post.autosave.content).to
|
|
137
|
+
expect(post.autosave.content).to include("Some content to autosave")
|
|
138
138
|
expect(Storytime::BlogPost.count).to eq(post_count)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
it "updates a post", js: true do
|
|
142
142
|
blog = @current_site.blogs.first
|
|
143
|
-
post =
|
|
143
|
+
post = FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil)
|
|
144
144
|
original_creator = post.user
|
|
145
145
|
post_count = Storytime::BlogPost.count
|
|
146
146
|
# page.driver.debug
|
|
@@ -157,14 +157,14 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
157
157
|
post = post.reload
|
|
158
158
|
post.draft_content = nil # clear the cached copy of draft_content so it reloads
|
|
159
159
|
expect(post.title).to eq("The Story")
|
|
160
|
-
expect(post.draft_content).to
|
|
160
|
+
expect(post.draft_content).to include("It was a dark and stormy night...")
|
|
161
161
|
expect(post.user).to eq(original_creator)
|
|
162
162
|
expect(post).to_not be_published
|
|
163
163
|
end
|
|
164
164
|
|
|
165
165
|
it "deletes a post", js: true do
|
|
166
166
|
blog = @current_site.blogs.first
|
|
167
|
-
3.times{
|
|
167
|
+
3.times{ FactoryBot.create(:post, blog: blog, site: @current_site) }
|
|
168
168
|
expect(Storytime::BlogPost.count).to eq(3)
|
|
169
169
|
|
|
170
170
|
post = Storytime::BlogPost.first
|
|
@@ -178,7 +178,7 @@ describe "In the dashboard, Posts", type: :feature do
|
|
|
178
178
|
|
|
179
179
|
it "deletes a post from the index view", js: true do
|
|
180
180
|
blog = @current_site.blogs.first
|
|
181
|
-
3.times{
|
|
181
|
+
3.times{ FactoryBot.create(:post, blog: blog, site: @current_site, published_at: nil) }
|
|
182
182
|
expect(Storytime::BlogPost.count).to eq(3)
|
|
183
183
|
|
|
184
184
|
post = Storytime::BlogPost.first
|
|
@@ -6,7 +6,7 @@ describe "In the dashboard, Snippets", type: :feature do
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "lists snippets", js: true do
|
|
9
|
-
3.times{
|
|
9
|
+
3.times{ FactoryBot.create(:snippet, site: @current_site) }
|
|
10
10
|
visit storytime.dashboard_url
|
|
11
11
|
find("#snippets-link").trigger('click')
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ describe "In the dashboard, Snippets", type: :feature do
|
|
|
37
37
|
# end
|
|
38
38
|
|
|
39
39
|
it "updates a snippet", js: true do
|
|
40
|
-
snippet =
|
|
40
|
+
snippet = FactoryBot.create(:snippet, site: @current_site, content: "Test")
|
|
41
41
|
|
|
42
42
|
visit storytime.dashboard_url
|
|
43
43
|
find("#snippets-link").trigger('click')
|
|
@@ -54,7 +54,7 @@ describe "In the dashboard, Snippets", type: :feature do
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
it "deletes a snippet", js: true do
|
|
57
|
-
snippet =
|
|
57
|
+
snippet = FactoryBot.create :snippet, site: @current_site
|
|
58
58
|
|
|
59
59
|
visit storytime.dashboard_url
|
|
60
60
|
find("#snippets-link").trigger('click')
|
|
@@ -6,7 +6,7 @@ describe "In the dashboard, Subscriptions", type: :feature do
|
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "lists subscriptions", js: true do
|
|
9
|
-
3.times{
|
|
9
|
+
3.times{ FactoryBot.create(:subscription, site: @current_site) }
|
|
10
10
|
visit storytime.dashboard_path
|
|
11
11
|
click_link "utility-menu-toggle"
|
|
12
12
|
click_link "subscriptions-link"
|
|
@@ -34,7 +34,7 @@ describe "In the dashboard, Subscriptions", type: :feature do
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
it "updates a subscription", js: true do
|
|
37
|
-
subscription =
|
|
37
|
+
subscription = FactoryBot.create(:subscription, site: @current_site)
|
|
38
38
|
|
|
39
39
|
expect(Storytime::Subscription.count).to eq(1)
|
|
40
40
|
expect(subscription.subscribed?).to eq(true)
|
data/spec/features/pages_spec.rb
CHANGED
|
@@ -2,13 +2,13 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Pages", type: :feature do
|
|
4
4
|
before do
|
|
5
|
-
setup_site(
|
|
5
|
+
setup_site(FactoryBot.create(:admin))
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "shows a page" do
|
|
9
|
-
pg =
|
|
9
|
+
pg = FactoryBot.create(:page, site: @current_site)
|
|
10
10
|
visit url_for([pg, only_path: true])
|
|
11
|
-
page.
|
|
11
|
+
expect(page).to have_content(pg.content)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
end
|
data/spec/features/posts_spec.rb
CHANGED
|
@@ -2,11 +2,11 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Posts", type: :feature do
|
|
4
4
|
before do
|
|
5
|
-
setup_site(
|
|
5
|
+
setup_site(FactoryBot.create(:admin))
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "shows a post" do
|
|
9
|
-
post =
|
|
9
|
+
post = FactoryBot.create(:post, blog: @current_site.blogs.first, site: @current_site)
|
|
10
10
|
visit url_for([post, only_path: true])
|
|
11
11
|
|
|
12
12
|
expect(page).to have_content(post.title)
|
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Subscriptions", type: :feature do
|
|
4
4
|
before do
|
|
5
|
-
setup_site(
|
|
5
|
+
setup_site(FactoryBot.create(:admin))
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
it "allows users to subscribe to a site" do
|
|
@@ -25,10 +25,10 @@ describe "Subscriptions", type: :feature do
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
it "only allows users to unsubscribe with a proper token" do
|
|
28
|
-
subscription_1 =
|
|
28
|
+
subscription_1 = FactoryBot.create(:subscription, site: @current_site)
|
|
29
29
|
token_1 = subscription_1.token
|
|
30
30
|
|
|
31
|
-
subscription_2 =
|
|
31
|
+
subscription_2 = FactoryBot.create(:subscription, site: @current_site)
|
|
32
32
|
token_2 = subscription_2.token
|
|
33
33
|
|
|
34
34
|
visit url_for([:unsubscribe_mailing_list, {:email => subscription_1.email, :t => token_2}])
|
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe Storytime::Importers::Wordpress do
|
|
4
4
|
let(:file){ File.open("./spec/support/files/wordpress_export.xml") }
|
|
5
|
-
let(:user){
|
|
5
|
+
let(:user){ FactoryBot.create(:user) }
|
|
6
6
|
let(:importer){ Storytime::Importers::Wordpress.new file, user }
|
|
7
7
|
|
|
8
8
|
describe "#import!" do
|
|
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Storytime::MysqlFulltextSearchAdapter" do
|
|
4
4
|
before(:each) do
|
|
5
|
-
@blog_posts =
|
|
6
|
-
@pages =
|
|
5
|
+
@blog_posts = FactoryBot.create_list(:post, 3)
|
|
6
|
+
@pages = FactoryBot.create_list(:page, 3)
|
|
7
7
|
|
|
8
8
|
Storytime.search_adapter = Storytime::MysqlFulltextSearchAdapter
|
|
9
9
|
end
|
|
@@ -19,7 +19,7 @@ describe "Storytime::MysqlFulltextSearchAdapter" do
|
|
|
19
19
|
it "searches only the given model" do
|
|
20
20
|
expect(Storytime::Post.count).to eq(6)
|
|
21
21
|
|
|
22
|
-
page =
|
|
22
|
+
page = FactoryBot.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
|
|
23
23
|
search_string = "bad mind"
|
|
24
24
|
|
|
25
25
|
expect(Storytime::Post.count).to eq(7)
|
|
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Storytime::MysqlSearchAdapter" do
|
|
4
4
|
before(:each) do
|
|
5
|
-
@blog_posts =
|
|
6
|
-
@pages =
|
|
5
|
+
@blog_posts = FactoryBot.create_list(:post, 3)
|
|
6
|
+
@pages = FactoryBot.create_list(:page, 3)
|
|
7
7
|
|
|
8
8
|
Storytime.search_adapter = Storytime::MysqlSearchAdapter
|
|
9
9
|
end
|
|
@@ -19,7 +19,7 @@ describe "Storytime::MysqlSearchAdapter" do
|
|
|
19
19
|
it "searches only the given model" do
|
|
20
20
|
expect(Storytime::Post.count).to eq(6)
|
|
21
21
|
|
|
22
|
-
page =
|
|
22
|
+
page = FactoryBot.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
|
|
23
23
|
search_string = "bad mind"
|
|
24
24
|
|
|
25
25
|
expect(Storytime::Post.count).to eq(7)
|
|
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Storytime::PostgresSearchAdapter" do
|
|
4
4
|
before(:each) do
|
|
5
|
-
@blog_posts =
|
|
6
|
-
@pages =
|
|
5
|
+
@blog_posts = FactoryBot.create_list(:post, 3)
|
|
6
|
+
@pages = FactoryBot.create_list(:page, 3)
|
|
7
7
|
|
|
8
8
|
Storytime.search_adapter = Storytime::PostgresSearchAdapter
|
|
9
9
|
end
|
|
@@ -19,7 +19,7 @@ describe "Storytime::PostgresSearchAdapter" do
|
|
|
19
19
|
it "searches only the given model" do
|
|
20
20
|
expect(Storytime::Post.count).to eq(6)
|
|
21
21
|
|
|
22
|
-
page =
|
|
22
|
+
page = FactoryBot.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
|
|
23
23
|
search_string = "bad mind"
|
|
24
24
|
|
|
25
25
|
expect(Storytime::Post.count).to eq(7)
|
|
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
describe "Storytime::Sqlite3SearchAdapter" do
|
|
4
4
|
before(:each) do
|
|
5
|
-
@blog_posts =
|
|
6
|
-
@pages =
|
|
5
|
+
@blog_posts = FactoryBot.create_list(:post, 3)
|
|
6
|
+
@pages = FactoryBot.create_list(:page, 3)
|
|
7
7
|
|
|
8
8
|
Storytime.search_adapter = Storytime::Sqlite3SearchAdapter
|
|
9
9
|
end
|
|
@@ -19,7 +19,7 @@ describe "Storytime::Sqlite3SearchAdapter" do
|
|
|
19
19
|
it "searches only the given model" do
|
|
20
20
|
expect(Storytime::Post.count).to eq(6)
|
|
21
21
|
|
|
22
|
-
page =
|
|
22
|
+
page = FactoryBot.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
|
|
23
23
|
search_string = "bad mind"
|
|
24
24
|
|
|
25
25
|
expect(Storytime::Post.count).to eq(7)
|