storytime 1.0.7 → 1.1.1

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/app/assets/javascripts/storytime/subscriptions.js +0 -2
  3. data/app/assets/javascripts/storytime/subscriptions.js.coffee +2 -0
  4. data/app/assets/stylesheets/storytime/posts.css.scss +5 -4
  5. data/app/assets/stylesheets/storytime/sites.css.scss +0 -4
  6. data/app/assets/stylesheets/storytime/subscriptions.css.scss +0 -0
  7. data/app/controllers/storytime/dashboard/posts_controller.rb +19 -2
  8. data/app/controllers/storytime/dashboard/subscriptions_controller.rb +83 -0
  9. data/app/controllers/storytime/posts_controller.rb +25 -0
  10. data/app/controllers/storytime/subscriptions_controller.rb +21 -5
  11. data/app/helpers/storytime/dashboard/media_helper.rb +1 -5
  12. data/app/helpers/storytime/subscriptions_helper.rb +16 -0
  13. data/app/mailers/storytime/subscription_mailer.rb +13 -0
  14. data/app/models/storytime/action.rb +1 -0
  15. data/app/models/storytime/permission.rb +12 -9
  16. data/app/models/storytime/post.rb +3 -3
  17. data/app/models/storytime/site.rb +15 -0
  18. data/app/models/storytime/subscription.rb +24 -0
  19. data/app/policies/storytime/post_policy.rb +1 -1
  20. data/app/policies/storytime/subscription_policy.rb +43 -0
  21. data/app/views/storytime/application/storytime/_header.html.erb +5 -1
  22. data/app/views/storytime/dashboard/_navigation.html.erb +2 -0
  23. data/app/views/storytime/dashboard/posts/_form.html.erb +6 -0
  24. data/app/views/storytime/dashboard/subscriptions/_subscription.html.erb +10 -0
  25. data/app/views/storytime/dashboard/subscriptions/edit.html.erb +10 -0
  26. data/app/views/storytime/dashboard/subscriptions/index.html.erb +19 -0
  27. data/app/views/storytime/dashboard/subscriptions/new.html.erb +9 -0
  28. data/app/views/storytime/subscription_mailer/new_post_email.html.erb +3 -2
  29. data/app/views/storytime/subscription_mailer/new_post_email.text.erb +7 -0
  30. data/app/views/storytime/subscriptions/_form.html.erb +5 -0
  31. data/app/views/storytime/subscriptions/_modal.html.erb +16 -0
  32. data/config/locales/en.yml +13 -1
  33. data/config/routes.rb +6 -15
  34. data/db/migrate/20141111164439_create_storytime_subscriptions.rb +14 -0
  35. data/db/migrate/20150122200805_add_title_and_content_index_to_storytime_post.rb +56 -0
  36. data/db/migrate/20150129215308_add_site_id_to_storytime_subscription.rb +5 -0
  37. data/lib/generators/templates/storytime.rb +9 -0
  38. data/lib/storytime/concerns/has_versions.rb +0 -1
  39. data/lib/storytime/engine.rb +2 -0
  40. data/lib/storytime/mysql_fulltext_search_adapter.rb +7 -0
  41. data/lib/storytime/mysql_search_adapter.rb +7 -0
  42. data/lib/storytime/postgres_search_adapter.rb +9 -0
  43. data/lib/storytime/sqlite3_search_adapter.rb +7 -0
  44. data/lib/storytime/version.rb +1 -1
  45. data/lib/storytime.rb +43 -0
  46. data/spec/controllers/subscriptions_controller_spec.rb +0 -0
  47. data/spec/dummy/config/environments/development.rb +8 -0
  48. data/spec/dummy/config/initializers/storytime.rb +37 -2
  49. data/spec/dummy/db/development.sqlite3 +0 -0
  50. data/spec/dummy/db/migrate/20150130213631_create_storytime_posts.storytime.rb +18 -0
  51. data/spec/dummy/db/migrate/20150130213632_create_friendly_id_slugs.storytime.rb +16 -0
  52. data/spec/dummy/db/migrate/20150130213633_create_storytime_media.storytime.rb +11 -0
  53. data/spec/dummy/db/migrate/20150130213634_create_storytime_sites.storytime.rb +14 -0
  54. data/spec/dummy/db/migrate/20150130213635_create_storytime_tags.storytime.rb +10 -0
  55. data/spec/dummy/db/migrate/20150130213636_create_storytime_taggings.storytime.rb +11 -0
  56. data/spec/dummy/db/migrate/20150130213637_create_storytime_versions.storytime.rb +13 -0
  57. data/spec/dummy/db/migrate/20150130213638_create_storytime_roles.storytime.rb +10 -0
  58. data/spec/dummy/db/migrate/20150130213639_add_storytime_role_id_to_users.storytime.rb +7 -0
  59. data/spec/dummy/db/migrate/20150130213640_create_storytime_permissions.storytime.rb +11 -0
  60. data/spec/dummy/db/migrate/20150130213641_create_storytime_actions.storytime.rb +11 -0
  61. data/spec/dummy/db/migrate/20150130213642_create_storytime_comments.storytime.rb +12 -0
  62. data/spec/dummy/db/migrate/20150130213643_add_storytime_name_to_users.storytime.rb +6 -0
  63. data/spec/dummy/db/migrate/20150130213644_create_storytime_autosaves.storytime.rb +13 -0
  64. data/spec/dummy/db/migrate/20150130213645_add_secondary_media_id_to_storytime_post.storytime.rb +6 -0
  65. data/spec/dummy/db/migrate/20150130213646_create_storytime_snippets.storytime.rb +22 -0
  66. data/spec/dummy/db/migrate/20150130213647_create_storytime_subscriptions.storytime.rb +15 -0
  67. data/spec/dummy/db/migrate/20150130213648_add_title_and_content_index_to_storytime_post.storytime.rb +57 -0
  68. data/spec/dummy/db/migrate/20150130213649_add_site_id_to_storytime_subscription.storytime.rb +6 -0
  69. data/spec/dummy/db/schema.rb +10 -2
  70. data/spec/dummy/db/test.sqlite3 +0 -0
  71. data/spec/factories/subscription_factories.rb +5 -5
  72. data/spec/features/dashboard/posts_spec.rb +0 -1
  73. data/spec/features/dashboard/subscription_spec.rb +37 -48
  74. data/spec/features/posts_spec.rb +2 -2
  75. data/spec/features/subscription_spec.rb +45 -15
  76. data/spec/lib/mysql_fulltext_search_adapter_spec.rb +31 -0
  77. data/spec/lib/mysql_search_adapter_spec.rb +31 -0
  78. data/spec/lib/postgres_search_adapter_spec.rb +31 -0
  79. data/spec/lib/sqlite3_search_adapter_spec.rb +31 -0
  80. data/spec/models/subscription_spec.rb +27 -27
  81. data/spec/requests/routings_spec.rb +2 -0
  82. metadata +71 -4
  83. data/app/views/storytime/subscription_mailer/new_post_email.txt.erb +0 -1
  84. data/lib/storytime/subscription_emails.rb +0 -17
@@ -11,8 +11,7 @@
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: 20141021073356) do
15
-
14
+ ActiveRecord::Schema.define(version: 20150129215308) do
16
15
  create_table "friendly_id_slugs", force: true do |t|
17
16
  t.string "slug", null: false
18
17
  t.integer "sluggable_id", null: false
@@ -115,6 +114,15 @@ ActiveRecord::Schema.define(version: 20141021073356) do
115
114
  t.datetime "updated_at"
116
115
  end
117
116
 
117
+ create_table "storytime_subscriptions", force: true do |t|
118
+ t.string "email"
119
+ t.boolean "subscribed", default: true
120
+ t.string "token"
121
+ t.datetime "created_at"
122
+ t.datetime "updated_at"
123
+ t.integer "site_id"
124
+ end
125
+
118
126
  create_table "storytime_taggings", force: true do |t|
119
127
  t.integer "tag_id"
120
128
  t.integer "post_id"
Binary file
@@ -1,5 +1,5 @@
1
- # FactoryGirl.define do
2
- # factory :subscription, class: Storytime::Subscription do
3
- # sequence(:email) { |n| "test_user_#{n}@example.com" }
4
- # end
5
- # end
1
+ FactoryGirl.define do
2
+ factory :subscription, class: Storytime::Subscription do
3
+ sequence(:email) { |n| "test_user_#{n}@example.com" }
4
+ end
5
+ end
@@ -118,5 +118,4 @@ describe "In the dashboard, Posts" do
118
118
  expect(page).to_not have_content(post.title)
119
119
  expect(Storytime::Post.count).to eq(2)
120
120
  end
121
-
122
121
  end
@@ -1,63 +1,52 @@
1
- # require 'spec_helper'
1
+ require 'spec_helper'
2
2
 
3
- # describe "In the dashboard, Subscriptions" do
4
- # before do
5
- # login_admin
6
- # end
3
+ describe "In the dashboard, Subscriptions" do
4
+ before do
5
+ login_admin
6
+ end
7
7
 
8
- # it "lists subscriptions" do
9
- # 3.times{ FactoryGirl.create(:subscription) }
10
- # visit url_for([:dashboard, Storytime::Subscription])
8
+ it "lists subscriptions" do
9
+ 3.times{ FactoryGirl.create(:subscription) }
10
+ visit url_for([:dashboard, Storytime::Subscription])
11
11
 
12
- # Storytime::Subscription.all.each do |s|
13
- # expect(page).to have_link("Edit", href: url_for([:edit, :dashboard, s]))
14
- # end
15
- # end
12
+ Storytime::Subscription.all.each do |s|
13
+ expect(page).to have_link("Edit", href: url_for([:edit, :dashboard, s]))
14
+ end
15
+ end
16
16
 
17
- # it "creates a subscription" do
18
- # expect(Storytime::Subscription.count).to eq(0)
17
+ it "creates a subscription" do
18
+ expect(Storytime::Subscription.count).to eq(0)
19
19
 
20
- # visit url_for([:new, :dashboard, :subscription, only_path: true])
21
- # fill_in "subscription_email", with: "some_random_email@example.com"
20
+ visit url_for([:new, :dashboard, :subscription, only_path: true])
21
+ fill_in "subscription_email", with: "some_random_email@example.com"
22
22
 
23
- # click_button "Create Subscription"
23
+ click_button "Create Subscription"
24
24
 
25
- # expect(page).to have_content(I18n.t('flash.subscriptions.create.success'))
26
- # expect(Storytime::Subscription.count).to eq(1)
25
+ expect(page).to have_content(I18n.t('flash.subscriptions.create.success'))
26
+ expect(Storytime::Subscription.count).to eq(1)
27
27
 
28
- # subscription = Storytime::Subscription.last
28
+ subscription = Storytime::Subscription.last
29
29
 
30
- # expect(subscription.email).to eq("some_random_email@example.com")
31
- # expect(subscription.token).to_not eq(nil)
32
- # end
30
+ expect(subscription.email).to eq("some_random_email@example.com")
31
+ expect(subscription.token).to_not eq(nil)
32
+ end
33
33
 
34
- # it "updates a subscription" do
35
- # subscription = FactoryGirl.create(:subscription)
34
+ it "updates a subscription" do
35
+ subscription = FactoryGirl.create(:subscription)
36
36
 
37
- # expect(Storytime::Subscription.count).to eq(1)
38
- # expect(subscription.subscribed?).to eq(true)
37
+ expect(Storytime::Subscription.count).to eq(1)
38
+ expect(subscription.subscribed?).to eq(true)
39
39
 
40
- # visit url_for([:edit, :dashboard, subscription])
41
- # fill_in "subscription_email", with: "johndoe@example.com"
42
- # uncheck "subscription_subscribed"
43
- # click_button "Update Subscription"
40
+ visit url_for([:edit, :dashboard, subscription])
41
+ fill_in "subscription_email", with: "johndoe@example.com"
42
+ uncheck "subscription_subscribed"
43
+ click_button "Update Subscription"
44
44
 
45
- # expect(page).to have_content(I18n.t('flash.subscriptions.update.success'))
45
+ expect(page).to have_content(I18n.t('flash.subscriptions.update.success'))
46
46
 
47
- # subscription.reload
47
+ subscription.reload
48
48
 
49
- # expect(subscription.email).to eq("johndoe@example.com")
50
- # expect(subscription.subscribed?).to eq(false)
51
- # end
52
-
53
- # describe "unsubscribe link" do
54
- # it "unsubscribes an email address" do
55
- # subscription = FactoryGirl.create(:subscription)
56
- # token = subscription.token
57
-
58
- # visit url_for([:dashboard, :subscriptions, :unsubscribe, {:t => token}])
59
-
60
- # expect(page).to have_content(I18n.t('dashboard.subscriptions.unsubscribe.message'))
61
- # end
62
- # end
63
- # end
49
+ expect(subscription.email).to eq("johndoe@example.com")
50
+ expect(subscription.subscribed?).to eq(false)
51
+ end
52
+ end
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'pry'
2
3
 
3
4
  describe "Posts" do
4
5
  before do
@@ -8,7 +9,7 @@ describe "Posts" do
8
9
  it "lists posts" do
9
10
  3.times{ FactoryGirl.create(:post) }
10
11
  static_page = FactoryGirl.create(:page)
11
- visit "/"
12
+ visit url_for([Storytime::BlogPost, only_path: true])
12
13
 
13
14
  within ".post-list" do
14
15
  Storytime::Post.primary_feed.each do |p|
@@ -29,5 +30,4 @@ describe "Posts" do
29
30
  expect(page).to have_content(post.title)
30
31
  expect(page).to have_content(post.content)
31
32
  end
32
-
33
33
  end
@@ -1,19 +1,49 @@
1
- # require 'spec_helper'
1
+ require 'spec_helper'
2
2
 
3
- # describe "Subscriptions" do
4
- # before do
5
- # setup_site
6
- # end
3
+ describe "Subscriptions" do
4
+ before do
5
+ setup_site
6
+ end
7
7
 
8
- # it "allows users to subscribe to a site" do
9
- # pending "test if user can find a link to subscribe, click the link, enter their email, and then get a confirmation"
10
- # end
8
+ it "allows users to subscribe to a site" do
9
+ expect(Storytime::Subscription.count).to eq(0)
11
10
 
12
- # it "allows users to unsubscribe from a site through a link" do
13
- # pending "test if user can goto a link and unsubscribe from a site"
14
- # end
11
+ site = Storytime::Site.last
12
+ email_address = "some_email_address@example.com"
15
13
 
16
- # it "only allows users to unsubscribe with a proper token" do
17
- # pending "test if user can unsubscribe with incorrect token"
18
- # end
19
- # end
14
+ visit "/"
15
+ click_link "#{I18n.t('layout.subscribe_to', site_name: site.title)}"
16
+ fill_in "subscription_email", with: email_address
17
+ click_button "Create Subscription"
18
+
19
+ expect(Storytime::Subscription.count).to eq(1)
20
+ subscription = Storytime::Subscription.first
21
+
22
+ expect(subscription.email).to eq(email_address)
23
+ expect(subscription.token).to_not eq(nil)
24
+ expect(subscription.subscribed?).to eq(true)
25
+ end
26
+
27
+ it "only allows users to unsubscribe with a proper token" do
28
+ subscription_1 = FactoryGirl.create(:subscription)
29
+ token_1 = subscription_1.token
30
+
31
+ subscription_2 = FactoryGirl.create(:subscription)
32
+ token_2 = subscription_2.token
33
+
34
+ visit url_for([:unsubscribe_mailing_list, {:email => subscription_1.email, :t => token_2}])
35
+
36
+ expect(page).to have_content(I18n.t('flash.subscriptions.destroy.fail'))
37
+ expect(subscription_1.subscribed?).to eq(true)
38
+
39
+ visit url_for([:unsubscribe_mailing_list, {:email => subscription_1.email, :t => token_1}])
40
+
41
+ expect(page).to have_content(I18n.t('flash.subscriptions.destroy.success'))
42
+
43
+ subscription_1.reload
44
+ subscription_2.reload
45
+
46
+ expect(subscription_1.subscribed?).to eq(false)
47
+ expect(subscription_2.subscribed?).to eq(true)
48
+ end
49
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Storytime::MysqlFulltextSearchAdapter" do
4
+ before(:each) do
5
+ @blog_posts = FactoryGirl.create_list(:post, 3)
6
+ @pages = FactoryGirl.create_list(:page, 3)
7
+
8
+ Storytime.search_adapter = Storytime::MysqlFulltextSearchAdapter
9
+ end
10
+
11
+ describe ".search" do
12
+ it "searches all storytime posts for a given search string" do
13
+ expect(Storytime::Post.count).to eq(6)
14
+ expect(Storytime::MysqlFulltextSearchAdapter).to receive(:search).with("end").and_return(@blog_posts)
15
+
16
+ Storytime.search_adapter.search("end")
17
+ end
18
+
19
+ it "searches only the given model" do
20
+ expect(Storytime::Post.count).to eq(6)
21
+
22
+ page = FactoryGirl.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
23
+ search_string = "bad mind"
24
+
25
+ expect(Storytime::Post.count).to eq(7)
26
+ expect(Storytime::MysqlFulltextSearchAdapter).to receive(:search).with(search_string, Storytime::Page).and_return(page)
27
+
28
+ Storytime.search_adapter.search(search_string, Storytime::Page)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Storytime::MysqlSearchAdapter" do
4
+ before(:each) do
5
+ @blog_posts = FactoryGirl.create_list(:post, 3)
6
+ @pages = FactoryGirl.create_list(:page, 3)
7
+
8
+ Storytime.search_adapter = Storytime::MysqlSearchAdapter
9
+ end
10
+
11
+ describe ".search" do
12
+ it "searches all storytime posts for a given search string" do
13
+ expect(Storytime::Post.count).to eq(6)
14
+ expect(Storytime::MysqlSearchAdapter).to receive(:search).with("end").and_return(@blog_posts)
15
+
16
+ Storytime.search_adapter.search("end")
17
+ end
18
+
19
+ it "searches only the given model" do
20
+ expect(Storytime::Post.count).to eq(6)
21
+
22
+ page = FactoryGirl.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
23
+ search_string = "bad mind"
24
+
25
+ expect(Storytime::Post.count).to eq(7)
26
+ expect(Storytime::MysqlSearchAdapter).to receive(:search).with(search_string, Storytime::Page).and_return(page)
27
+
28
+ Storytime.search_adapter.search(search_string, Storytime::Page)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Storytime::PostgresSearchAdapter" do
4
+ before(:each) do
5
+ @blog_posts = FactoryGirl.create_list(:post, 3)
6
+ @pages = FactoryGirl.create_list(:page, 3)
7
+
8
+ Storytime.search_adapter = Storytime::PostgresSearchAdapter
9
+ end
10
+
11
+ describe ".search" do
12
+ it "searches all storytime posts for a given search string" do
13
+ expect(Storytime::Post.count).to eq(6)
14
+ expect(Storytime::PostgresSearchAdapter).to receive(:search).with("end").and_return(@blog_posts)
15
+
16
+ Storytime.search_adapter.search("end")
17
+ end
18
+
19
+ it "searches only the given model" do
20
+ expect(Storytime::Post.count).to eq(6)
21
+
22
+ page = FactoryGirl.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
23
+ search_string = "bad mind"
24
+
25
+ expect(Storytime::Post.count).to eq(7)
26
+ expect(Storytime::PostgresSearchAdapter).to receive(:search).with(search_string, Storytime::Page).and_return(page)
27
+
28
+ Storytime.search_adapter.search(search_string, Storytime::Page)
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Storytime::Sqlite3SearchAdapter" do
4
+ before(:each) do
5
+ @blog_posts = FactoryGirl.create_list(:post, 3)
6
+ @pages = FactoryGirl.create_list(:page, 3)
7
+
8
+ Storytime.search_adapter = Storytime::Sqlite3SearchAdapter
9
+ end
10
+
11
+ describe ".search" do
12
+ it "searches all storytime posts for a given search string" do
13
+ expect(Storytime::Post.count).to eq(6)
14
+ expect(Storytime::Sqlite3SearchAdapter).to receive(:search).with("end").and_return(@blog_posts)
15
+
16
+ Storytime.search_adapter.search("end")
17
+ end
18
+
19
+ it "searches only the given model" do
20
+ expect(Storytime::Post.count).to eq(6)
21
+
22
+ page = FactoryGirl.create(:page, content: "Everything bad comes from the mind, because the mind asks too many questions.")
23
+ search_string = "bad mind"
24
+
25
+ expect(Storytime::Post.count).to eq(7)
26
+ expect(Storytime::Sqlite3SearchAdapter).to receive(:search).with(search_string, Storytime::Page).and_return(page)
27
+
28
+ Storytime.search_adapter.search(search_string, Storytime::Page)
29
+ end
30
+ end
31
+ end
@@ -1,38 +1,38 @@
1
- # require 'spec_helper'
1
+ require 'spec_helper'
2
2
 
3
- # describe Storytime::Subscription do
4
- # describe "generate_token" do
5
- # it "generates a token before creation" do
6
- # subscription = FactoryGirl.build(:subscription)
3
+ describe Storytime::Subscription do
4
+ describe "generate_token" do
5
+ it "generates a token before creation" do
6
+ subscription = FactoryGirl.build(:subscription)
7
7
 
8
- # expect(subscription.token).to eq(nil)
8
+ expect(subscription.token).to eq(nil)
9
9
 
10
- # subscription.save
10
+ subscription.save
11
11
 
12
- # expect(subscription.token).to_not eq(nil)
13
- # end
12
+ expect(subscription.token).to_not eq(nil)
13
+ end
14
14
 
15
- # it "generates a token that can be regenerated from the email" do
16
- # subscription = FactoryGirl.create(:subscription)
17
- # token = subscription.token
15
+ it "generates a token that can be regenerated from the email" do
16
+ subscription = FactoryGirl.create(:subscription)
17
+ token = subscription.token
18
18
 
19
- # key = Rails.application.secrets.secret_key_base
20
- # digest = OpenSSL::Digest.new('sha1')
21
- # regenerated_token = OpenSSL::HMAC.hexdigest(digest, key, subscription.email)
19
+ key = Rails.application.secrets.secret_key_base
20
+ digest = OpenSSL::Digest.new('sha1')
21
+ regenerated_token = OpenSSL::HMAC.hexdigest(digest, key, subscription.email)
22
22
 
23
- # expect(token).to eq(regenerated_token)
24
- # end
25
- # end
23
+ expect(token).to eq(regenerated_token)
24
+ end
25
+ end
26
26
 
27
- # describe "unsubscribe!" do
28
- # it "sets subscribed to false" do
29
- # subscription = FactoryGirl.create(:subscription)
27
+ describe "unsubscribe!" do
28
+ it "sets subscribed to false" do
29
+ subscription = FactoryGirl.create(:subscription)
30
30
 
31
- # expect(subscription.subscribed?).to eq(true)
31
+ expect(subscription.subscribed?).to eq(true)
32
32
 
33
- # subscription.unsubscribe!
33
+ subscription.unsubscribe!
34
34
 
35
- # expect(subscription.subscribed?).to eq(false)
36
- # end
37
- # end
38
- # end
35
+ expect(subscription.subscribed?).to eq(false)
36
+ end
37
+ end
38
+ end
@@ -4,6 +4,7 @@ describe "Root path" do
4
4
  it "routes to posts#index when site#root_page_content is posts" do
5
5
  FactoryGirl.create(:site, root_page_content: :posts)
6
6
  get "/"
7
+
7
8
  expect(request.params[:controller]).to eq("storytime/posts")
8
9
  expect(request.params[:action]).to eq("index")
9
10
  end
@@ -12,6 +13,7 @@ describe "Root path" do
12
13
  home_page = FactoryGirl.create(:page)
13
14
  FactoryGirl.create(:site, root_page_content: :page, root_post_id: home_page.id)
14
15
  get "/"
16
+
15
17
  expect(request.params[:controller]).to eq("storytime/pages")
16
18
  expect(request.params[:action]).to eq("show")
17
19
  expect(response.body).to match(home_page.title)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storytime
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Roesch, David Van Der Beek, Brandon Robins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -475,6 +475,7 @@ files:
475
475
  - app/assets/javascripts/storytime/sites.js.coffee
476
476
  - app/assets/javascripts/storytime/snippets.js.coffee
477
477
  - app/assets/javascripts/storytime/subscriptions.js
478
+ - app/assets/javascripts/storytime/subscriptions.js.coffee
478
479
  - app/assets/javascripts/storytime/utilities.js
479
480
  - app/assets/stylesheets/storytime/admin.css.scss
480
481
  - app/assets/stylesheets/storytime/application.css.scss
@@ -484,6 +485,7 @@ files:
484
485
  - app/assets/stylesheets/storytime/pagination.css.scss
485
486
  - app/assets/stylesheets/storytime/posts.css.scss
486
487
  - app/assets/stylesheets/storytime/sites.css.scss
488
+ - app/assets/stylesheets/storytime/subscriptions.css.scss
487
489
  - app/assets/stylesheets/storytime/versions.css.scss
488
490
  - app/controllers/storytime/application_controller.rb
489
491
  - app/controllers/storytime/comments_controller.rb
@@ -494,6 +496,7 @@ files:
494
496
  - app/controllers/storytime/dashboard/roles_controller.rb
495
497
  - app/controllers/storytime/dashboard/sites_controller.rb
496
498
  - app/controllers/storytime/dashboard/snippets_controller.rb
499
+ - app/controllers/storytime/dashboard/subscriptions_controller.rb
497
500
  - app/controllers/storytime/dashboard/users_controller.rb
498
501
  - app/controllers/storytime/dashboard_controller.rb
499
502
  - app/controllers/storytime/pages_controller.rb
@@ -505,7 +508,9 @@ files:
505
508
  - app/helpers/storytime/dashboard/posts_helper.rb
506
509
  - app/helpers/storytime/dashboard/sites_helper.rb
507
510
  - app/helpers/storytime/dashboard/versions_helper.rb
511
+ - app/helpers/storytime/subscriptions_helper.rb
508
512
  - app/inputs/date_time_picker_input.rb
513
+ - app/mailers/storytime/subscription_mailer.rb
509
514
  - app/models/concerns/storytime/enum.rb
510
515
  - app/models/storytime/action.rb
511
516
  - app/models/storytime/autosave.rb
@@ -518,6 +523,7 @@ files:
518
523
  - app/models/storytime/role.rb
519
524
  - app/models/storytime/site.rb
520
525
  - app/models/storytime/snippet.rb
526
+ - app/models/storytime/subscription.rb
521
527
  - app/models/storytime/tag.rb
522
528
  - app/models/storytime/tagging.rb
523
529
  - app/models/storytime/version.rb
@@ -527,6 +533,7 @@ files:
527
533
  - app/policies/storytime/post_policy.rb
528
534
  - app/policies/storytime/site_policy.rb
529
535
  - app/policies/storytime/snippet_policy.rb
536
+ - app/policies/storytime/subscription_policy.rb
530
537
  - app/policies/user_policy.rb
531
538
  - app/uploaders/storytime/media_uploader.rb
532
539
  - app/views/layouts/storytime/application.html.erb
@@ -566,6 +573,10 @@ files:
566
573
  - app/views/storytime/dashboard/snippets/edit.html.erb
567
574
  - app/views/storytime/dashboard/snippets/index.html.erb
568
575
  - app/views/storytime/dashboard/snippets/new.html.erb
576
+ - app/views/storytime/dashboard/subscriptions/_subscription.html.erb
577
+ - app/views/storytime/dashboard/subscriptions/edit.html.erb
578
+ - app/views/storytime/dashboard/subscriptions/index.html.erb
579
+ - app/views/storytime/dashboard/subscriptions/new.html.erb
569
580
  - app/views/storytime/dashboard/users/_user.html.erb
570
581
  - app/views/storytime/dashboard/users/edit.html.erb
571
582
  - app/views/storytime/dashboard/users/index.html.erb
@@ -578,7 +589,9 @@ files:
578
589
  - app/views/storytime/posts/show.html.erb
579
590
  - app/views/storytime/sites/_google_analytics_code.html.erb
580
591
  - app/views/storytime/subscription_mailer/new_post_email.html.erb
581
- - app/views/storytime/subscription_mailer/new_post_email.txt.erb
592
+ - app/views/storytime/subscription_mailer/new_post_email.text.erb
593
+ - app/views/storytime/subscriptions/_form.html.erb
594
+ - app/views/storytime/subscriptions/_modal.html.erb
582
595
  - config/initializers/assets.rb
583
596
  - config/initializers/friendly_id.rb
584
597
  - config/initializers/inflections.rb
@@ -607,6 +620,9 @@ files:
607
620
  - db/migrate/20140916183056_create_storytime_autosaves.rb
608
621
  - db/migrate/20141020213343_add_secondary_media_id_to_storytime_post.rb
609
622
  - db/migrate/20141021073356_create_storytime_snippets.rb
623
+ - db/migrate/20141111164439_create_storytime_subscriptions.rb
624
+ - db/migrate/20150122200805_add_title_and_content_index_to_storytime_post.rb
625
+ - db/migrate/20150129215308_add_site_id_to_storytime_subscription.rb
610
626
  - db/seeds.rb
611
627
  - lib/generators/storytime/install_generator.rb
612
628
  - lib/generators/storytime/views_generator.rb
@@ -620,11 +636,15 @@ files:
620
636
  - lib/storytime/engine.rb
621
637
  - lib/storytime/importers/importer.rb
622
638
  - lib/storytime/importers/wordpress.rb
623
- - lib/storytime/subscription_emails.rb
639
+ - lib/storytime/mysql_fulltext_search_adapter.rb
640
+ - lib/storytime/mysql_search_adapter.rb
641
+ - lib/storytime/postgres_search_adapter.rb
642
+ - lib/storytime/sqlite3_search_adapter.rb
624
643
  - lib/storytime/version.rb
625
644
  - lib/tasks/storytime_tasks.rake
626
645
  - lib/templates/erb/scaffold/_form.html.erb
627
646
  - spec/controllers/dashboard_controller_spec.rb
647
+ - spec/controllers/subscriptions_controller_spec.rb
628
648
  - spec/dummy/README.rdoc
629
649
  - spec/dummy/Rakefile
630
650
  - spec/dummy/app/assets/javascripts/application.js
@@ -659,6 +679,25 @@ files:
659
679
  - spec/dummy/config/secrets.yml
660
680
  - spec/dummy/db/development.sqlite3
661
681
  - spec/dummy/db/migrate/20140530185250_devise_create_users.rb
682
+ - spec/dummy/db/migrate/20150130213631_create_storytime_posts.storytime.rb
683
+ - spec/dummy/db/migrate/20150130213632_create_friendly_id_slugs.storytime.rb
684
+ - spec/dummy/db/migrate/20150130213633_create_storytime_media.storytime.rb
685
+ - spec/dummy/db/migrate/20150130213634_create_storytime_sites.storytime.rb
686
+ - spec/dummy/db/migrate/20150130213635_create_storytime_tags.storytime.rb
687
+ - spec/dummy/db/migrate/20150130213636_create_storytime_taggings.storytime.rb
688
+ - spec/dummy/db/migrate/20150130213637_create_storytime_versions.storytime.rb
689
+ - spec/dummy/db/migrate/20150130213638_create_storytime_roles.storytime.rb
690
+ - spec/dummy/db/migrate/20150130213639_add_storytime_role_id_to_users.storytime.rb
691
+ - spec/dummy/db/migrate/20150130213640_create_storytime_permissions.storytime.rb
692
+ - spec/dummy/db/migrate/20150130213641_create_storytime_actions.storytime.rb
693
+ - spec/dummy/db/migrate/20150130213642_create_storytime_comments.storytime.rb
694
+ - spec/dummy/db/migrate/20150130213643_add_storytime_name_to_users.storytime.rb
695
+ - spec/dummy/db/migrate/20150130213644_create_storytime_autosaves.storytime.rb
696
+ - spec/dummy/db/migrate/20150130213645_add_secondary_media_id_to_storytime_post.storytime.rb
697
+ - spec/dummy/db/migrate/20150130213646_create_storytime_snippets.storytime.rb
698
+ - spec/dummy/db/migrate/20150130213647_create_storytime_subscriptions.storytime.rb
699
+ - spec/dummy/db/migrate/20150130213648_add_title_and_content_index_to_storytime_post.storytime.rb
700
+ - spec/dummy/db/migrate/20150130213649_add_site_id_to_storytime_subscription.storytime.rb
662
701
  - spec/dummy/db/schema.rb
663
702
  - spec/dummy/db/test.sqlite3
664
703
  - spec/dummy/public/404.html
@@ -687,6 +726,10 @@ files:
687
726
  - spec/features/posts_spec.rb
688
727
  - spec/features/subscription_spec.rb
689
728
  - spec/importers/wordpress_spec.rb
729
+ - spec/lib/mysql_fulltext_search_adapter_spec.rb
730
+ - spec/lib/mysql_search_adapter_spec.rb
731
+ - spec/lib/postgres_search_adapter_spec.rb
732
+ - spec/lib/sqlite3_search_adapter_spec.rb
690
733
  - spec/lib/storytime_spec.rb
691
734
  - spec/models/post_spec.rb
692
735
  - spec/models/subscription_spec.rb
@@ -743,6 +786,7 @@ specification_version: 4
743
786
  summary: A simple cms and blogging engine for rails apps.
744
787
  test_files:
745
788
  - spec/controllers/dashboard_controller_spec.rb
789
+ - spec/controllers/subscriptions_controller_spec.rb
746
790
  - spec/dummy/app/assets/javascripts/application.js
747
791
  - spec/dummy/app/assets/stylesheets/application.css
748
792
  - spec/dummy/app/controllers/application_controller.rb
@@ -775,6 +819,25 @@ test_files:
775
819
  - spec/dummy/config.ru
776
820
  - spec/dummy/db/development.sqlite3
777
821
  - spec/dummy/db/migrate/20140530185250_devise_create_users.rb
822
+ - spec/dummy/db/migrate/20150130213631_create_storytime_posts.storytime.rb
823
+ - spec/dummy/db/migrate/20150130213632_create_friendly_id_slugs.storytime.rb
824
+ - spec/dummy/db/migrate/20150130213633_create_storytime_media.storytime.rb
825
+ - spec/dummy/db/migrate/20150130213634_create_storytime_sites.storytime.rb
826
+ - spec/dummy/db/migrate/20150130213635_create_storytime_tags.storytime.rb
827
+ - spec/dummy/db/migrate/20150130213636_create_storytime_taggings.storytime.rb
828
+ - spec/dummy/db/migrate/20150130213637_create_storytime_versions.storytime.rb
829
+ - spec/dummy/db/migrate/20150130213638_create_storytime_roles.storytime.rb
830
+ - spec/dummy/db/migrate/20150130213639_add_storytime_role_id_to_users.storytime.rb
831
+ - spec/dummy/db/migrate/20150130213640_create_storytime_permissions.storytime.rb
832
+ - spec/dummy/db/migrate/20150130213641_create_storytime_actions.storytime.rb
833
+ - spec/dummy/db/migrate/20150130213642_create_storytime_comments.storytime.rb
834
+ - spec/dummy/db/migrate/20150130213643_add_storytime_name_to_users.storytime.rb
835
+ - spec/dummy/db/migrate/20150130213644_create_storytime_autosaves.storytime.rb
836
+ - spec/dummy/db/migrate/20150130213645_add_secondary_media_id_to_storytime_post.storytime.rb
837
+ - spec/dummy/db/migrate/20150130213646_create_storytime_snippets.storytime.rb
838
+ - spec/dummy/db/migrate/20150130213647_create_storytime_subscriptions.storytime.rb
839
+ - spec/dummy/db/migrate/20150130213648_add_title_and_content_index_to_storytime_post.storytime.rb
840
+ - spec/dummy/db/migrate/20150130213649_add_site_id_to_storytime_subscription.storytime.rb
778
841
  - spec/dummy/db/schema.rb
779
842
  - spec/dummy/db/test.sqlite3
780
843
  - spec/dummy/public/404.html
@@ -805,6 +868,10 @@ test_files:
805
868
  - spec/features/posts_spec.rb
806
869
  - spec/features/subscription_spec.rb
807
870
  - spec/importers/wordpress_spec.rb
871
+ - spec/lib/mysql_fulltext_search_adapter_spec.rb
872
+ - spec/lib/mysql_search_adapter_spec.rb
873
+ - spec/lib/postgres_search_adapter_spec.rb
874
+ - spec/lib/sqlite3_search_adapter_spec.rb
808
875
  - spec/lib/storytime_spec.rb
809
876
  - spec/models/post_spec.rb
810
877
  - spec/models/subscription_spec.rb
@@ -1 +0,0 @@
1
- Yay? There is a new post...
@@ -1,17 +0,0 @@
1
- module Storytime
2
- module SubscriptionEmails
3
- class << self
4
- def process(post)
5
- subscribers = Storytime::Subscription.subscribers.pluck(:email)
6
-
7
- subscribers.each do |s|
8
- # if Storytime.delayed_job == false
9
- Storytime::SubscriptionMailer.new_post_email(s).delay.deliver
10
- # elsif Storytime
11
- # Storytime::SubscriptionMailer.new_post_email(s).deliver
12
- # end
13
- end
14
- end
15
- end
16
- end
17
- end