paid_up 0.11.7 → 0.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +17 -13
  3. data/.rubocop_todo.yml +7 -0
  4. data/.travis.yml +4 -3
  5. data/Gemfile +29 -24
  6. data/README.md +22 -1
  7. data/Rakefile +6 -5
  8. data/VERSION +1 -1
  9. data/app/controllers/paid_up/paid_up_controller.rb +16 -9
  10. data/app/controllers/paid_up/plans_controller.rb +2 -0
  11. data/app/controllers/paid_up/subscriptions_controller.rb +58 -49
  12. data/app/helpers/paid_up/features_helper.rb +35 -34
  13. data/app/helpers/paid_up/paid_up_helper.rb +10 -8
  14. data/app/helpers/paid_up/plans_helper.rb +75 -55
  15. data/app/helpers/paid_up/subscriptions_helper.rb +17 -13
  16. data/app/models/paid_up/ability.rb +53 -46
  17. data/app/models/paid_up/plan.rb +36 -34
  18. data/app/models/paid_up/plan_feature_setting.rb +2 -0
  19. data/app/models/paid_up/unlimited.rb +2 -0
  20. data/app/views/paid_up/features/_abilities_table.html.haml +1 -45
  21. data/app/views/paid_up/features/_boolean_state.html.haml +6 -0
  22. data/app/views/paid_up/features/_setting_state.html.haml +13 -0
  23. data/app/views/paid_up/subscriptions/index.html.haml +2 -2
  24. data/config/initializers/stripe.rb +2 -0
  25. data/config/locales/en.yml +4 -1
  26. data/config/routes.rb +3 -1
  27. data/lib/generators/paid_up/install/install_generator.rb +4 -1
  28. data/lib/generators/paid_up/install/templates/ability.rb +2 -0
  29. data/lib/generators/paid_up/install/templates/initializer.rb +2 -0
  30. data/lib/generators/paid_up/utils.rb +2 -0
  31. data/lib/paid_up/configuration.rb +4 -2
  32. data/lib/paid_up/engine.rb +2 -0
  33. data/lib/paid_up/extensions/integer.rb +2 -0
  34. data/lib/paid_up/extensions/stripe.rb +2 -0
  35. data/lib/paid_up/feature.rb +10 -7
  36. data/lib/paid_up/feature_setting_type.rb +45 -0
  37. data/lib/paid_up/feature_setting_types/rolify.rb +10 -0
  38. data/lib/paid_up/feature_setting_types/table.rb +7 -0
  39. data/lib/paid_up/localization.rb +2 -0
  40. data/lib/paid_up/mixins/paid_for.rb +59 -47
  41. data/lib/paid_up/mixins/subscriber.rb +45 -101
  42. data/lib/paid_up/railtie.rb +2 -0
  43. data/lib/paid_up/ruby_version_check.rb +15 -0
  44. data/lib/paid_up/subscription.rb +80 -0
  45. data/lib/paid_up/validators/rolify_rows.rb +11 -6
  46. data/lib/paid_up/validators/table_rows.rb +9 -6
  47. data/lib/paid_up/version.rb +2 -0
  48. data/lib/paid_up.rb +8 -0
  49. data/paid_up.gemspec +108 -115
  50. data/spec/controllers/paid_up/plans_spec.rb +2 -0
  51. data/spec/controllers/paid_up/subscriptions_spec.rb +18 -11
  52. data/spec/dummy/Rakefile +2 -0
  53. data/spec/dummy/app/assets/stylesheets/application.css.scss +6 -0
  54. data/spec/dummy/app/controllers/application_controller.rb +2 -0
  55. data/spec/dummy/app/models/ability.rb +2 -0
  56. data/spec/dummy/app/models/doodad.rb +2 -0
  57. data/spec/dummy/app/models/group.rb +2 -0
  58. data/spec/dummy/app/models/post.rb +2 -0
  59. data/spec/dummy/app/models/role.rb +2 -0
  60. data/spec/dummy/app/models/user.rb +2 -0
  61. data/spec/dummy/app/views/layouts/application.html.haml +13 -11
  62. data/spec/dummy/bin/bundle +2 -0
  63. data/spec/dummy/bin/rails +2 -0
  64. data/spec/dummy/bin/rake +2 -0
  65. data/spec/dummy/bin/setup +10 -8
  66. data/spec/dummy/config/application.rb +2 -3
  67. data/spec/dummy/config/boot.rb +2 -0
  68. data/spec/dummy/config/environment.rb +2 -0
  69. data/spec/dummy/config/environments/development.rb +2 -0
  70. data/spec/dummy/config/environments/test.rb +2 -4
  71. data/spec/dummy/config/initializers/assets.rb +2 -0
  72. data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -0
  73. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  74. data/spec/dummy/config/initializers/devise.rb +2 -0
  75. data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
  76. data/spec/dummy/config/initializers/inflections.rb +1 -0
  77. data/spec/dummy/config/initializers/mime_types.rb +1 -0
  78. data/spec/dummy/config/initializers/paid_up.rb +10 -16
  79. data/spec/dummy/config/initializers/rolify.rb +2 -0
  80. data/spec/dummy/config/initializers/session_store.rb +2 -0
  81. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
  82. data/spec/dummy/config/routes.rb +2 -0
  83. data/spec/dummy/config.ru +2 -0
  84. data/spec/dummy/db/schema.rb +14 -23
  85. data/spec/dummy/db/seeds.rb +8 -6
  86. data/spec/dummy/db/test.sqlite3 +0 -0
  87. data/spec/dummy/lib/tasks/system.rake +2 -0
  88. data/spec/factories/doodad.rb +2 -0
  89. data/spec/factories/group.rb +2 -0
  90. data/spec/factories/plan.rb +2 -0
  91. data/spec/factories/plan_feature_setting.rb +2 -0
  92. data/spec/factories/post.rb +2 -0
  93. data/spec/factories/user.rb +3 -1
  94. data/spec/models/group_spec.rb +9 -7
  95. data/spec/models/paid_up/feature_spec.rb +2 -0
  96. data/spec/models/paid_up/plan_feature_setting_spec.rb +2 -0
  97. data/spec/models/paid_up/plan_spec.rb +2 -0
  98. data/spec/models/scope_spec.rb +9 -7
  99. data/spec/models/user_spec.rb +60 -58
  100. data/spec/paid_up_spec.rb +2 -0
  101. data/spec/rails_helper.rb +16 -2
  102. data/spec/routing/paid_up/plans_spec.rb +2 -0
  103. data/spec/routing/paid_up/subscription_spec.rb +2 -0
  104. data/spec/spec_helper.rb +2 -0
  105. data/spec/support/controller_macros.rb +2 -0
  106. data/spec/support/factory_girl.rb +2 -0
  107. data/spec/support/loaded_site/features.rb +2 -0
  108. data/spec/support/loaded_site/groups.rb +2 -0
  109. data/spec/support/loaded_site/loaded_site.rb +2 -0
  110. data/spec/support/loaded_site/plans.rb +2 -0
  111. data/spec/support/loaded_site/posts.rb +2 -0
  112. data/spec/support/loaded_site/users.rb +4 -2
  113. data/spec/support/stripe.rb +2 -0
  114. data/spec/views/paid_up/plans_spec.rb +9 -7
  115. data/spec/views/paid_up/subscriptions_spec.rb +20 -19
  116. metadata +124 -90
  117. data/app/views/devise/confirmations/new.html.haml +0 -13
  118. data/app/views/devise/passwords/edit.html.haml +0 -19
  119. data/app/views/devise/passwords/new.html.haml +0 -14
  120. data/app/views/devise/registrations/_new_form.html.haml +0 -23
  121. data/app/views/devise/registrations/edit.html.haml +0 -39
  122. data/app/views/devise/registrations/new.html.haml +0 -11
  123. data/app/views/devise/sessions/_new_form.html.haml +0 -21
  124. data/app/views/devise/sessions/new.html.haml +0 -11
  125. data/app/views/devise/shared/_links.html.haml +0 -14
  126. data/app/views/devise/unlocks/new.html.haml +0 -14
  127. data/app/views/layouts/mailer.html.haml +0 -3
  128. data/app/views/layouts/mailer.text.haml +0 -1
  129. data/app/views/paid_up/subscription_mailer/payment_failed_email.html.haml +0 -0
  130. data/app/views/paid_up/subscription_mailer/payment_failed_email.text.haml +0 -0
  131. data/coverage/.last_run.json +0 -5
  132. data/coverage/.resultset.json +0 -1927
  133. data/spec/dummy/app/views/pages/index.html.haml +0 -1
  134. data/spec/dummy/config/environments/production.rb +0 -83
  135. data/spec/dummy/config/initializers/high_voltage.rb +0 -3
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Use this hook to configure devise mailer, warden hooks and so forth.
2
4
  # Many of these configuration options can be set straight in your model.
3
5
  Devise.setup do |config|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # Configure sensitive parameters which will be filtered from the log file.
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Be sure to restart your server when you modify this file.
2
3
 
3
4
  # Add new inflection rules using the following format. Inflections
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Be sure to restart your server when you modify this file.
2
3
 
3
4
  # Add new mime types for use in respond_to blocks:
@@ -1,33 +1,27 @@
1
+ # frozen_string_literal: true
2
+
1
3
  PaidUp.configure do |config|
2
4
  config.anonymous_customer_stripe_id = 'anonymous-customer'
3
5
  config.anonymous_plan_stripe_id = 'anonymous-plan'
4
6
  config.free_plan_stripe_id = 'free-plan'
5
7
 
6
8
  PaidUp.add_feature(
7
- slug: 'ad_free',
8
- title: 'Ad Free',
9
- description: 'Are ads removed from the site with this plan?',
10
- setting_type: 'boolean'
9
+ slug: 'ad_free', title: 'Ad Free', setting_type: 'boolean',
10
+ description: 'Are ads removed from the site with this plan?'
11
11
  )
12
12
  PaidUp.add_feature(
13
- slug: 'groups',
14
- title: 'Groups',
15
- description: 'How many groups are allowed with this plan?',
13
+ slug: 'groups', title: 'Groups', setting_type: 'rolify_rows',
14
+ description: 'How many groups are allowed with this plan?'
16
15
  # Enables table row counting that is enabled by a positive value
17
16
  # for the PaidUp::PlanFeatureSetting.setting associated with this
18
17
  # PaidUp::Feature
19
- setting_type: 'rolify_rows'
20
18
  )
21
19
  PaidUp.add_feature(
22
- slug: 'doodads',
23
- title: 'Doodads',
24
- description: 'How many doodads included with this plan?',
25
- setting_type: 'table_rows'
20
+ slug: 'doodads', title: 'Doodads', setting_type: 'table_rows',
21
+ description: 'How many doodads included with this plan?'
26
22
  )
27
23
  PaidUp.add_feature(
28
- slug: 'posts',
29
- title: 'Posts',
30
- description: 'How many posts included with this plan?',
31
- setting_type: 'table_rows'
24
+ slug: 'posts', title: 'Posts', setting_type: 'table_rows',
25
+ description: 'How many posts included with this plan?'
32
26
  )
33
27
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rolify.configure do |config|
2
4
  # By default ORM adapter is ActiveRecord. uncomment to use mongoid
3
5
  # config.use_mongoid
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Be sure to restart your server when you modify this file.
2
4
 
3
5
  # This file contains settings for ActionController::ParamsWrapper which
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.routes.draw do
2
4
  devise_for :users
3
5
  mount PaidUp::Engine => '/', as: 'paid_up'
data/spec/dummy/config.ru CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file is used by Rack-based servers to start the application.
2
4
 
3
5
  require ::File.expand_path('../config/environment', __FILE__)
@@ -1,4 +1,3 @@
1
- # encoding: UTF-8
2
1
  # This file is auto-generated from the current state of the database. Instead
3
2
  # of editing this file, please use the migrations feature of Active Record to
4
3
  # incrementally modify your database, and then regenerate this schema definition.
@@ -17,29 +16,26 @@ ActiveRecord::Schema.define(version: 20170220001913) do
17
16
  t.string "user_id"
18
17
  t.string "name"
19
18
  t.text "description"
19
+ t.index ["user_id"], name: "index_doodads_on_user_id"
20
20
  end
21
21
 
22
- add_index "doodads", ["user_id"], name: "index_doodads_on_user_id"
23
-
24
22
  create_table "groups", force: :cascade do |t|
25
23
  t.string "title"
26
24
  t.text "description"
27
25
  t.datetime "created_at"
28
26
  t.datetime "updated_at"
29
27
  t.boolean "active", default: false, null: false
28
+ t.index ["active"], name: "index_groups_on_active"
30
29
  end
31
30
 
32
- add_index "groups", ["active"], name: "index_groups_on_active"
33
-
34
31
  create_table "paid_up_plan_feature_settings", force: :cascade do |t|
35
32
  t.integer "paid_up_plan_id"
36
33
  t.string "feature"
37
34
  t.integer "setting"
35
+ t.index ["feature"], name: "index_paid_up_plan_feature_settings_on_feature"
36
+ t.index ["paid_up_plan_id"], name: "index_paid_up_plan_feature_settings_on_paid_up_plan_id"
38
37
  end
39
38
 
40
- add_index "paid_up_plan_feature_settings", ["feature"], name: "index_paid_up_plan_feature_settings_on_feature"
41
- add_index "paid_up_plan_feature_settings", ["paid_up_plan_id"], name: "index_paid_up_plan_feature_settings_on_paid_up_plan_id"
42
-
43
39
  create_table "paid_up_plans", force: :cascade do |t|
44
40
  t.string "stripe_id"
45
41
  t.string "title"
@@ -47,33 +43,30 @@ ActiveRecord::Schema.define(version: 20170220001913) do
47
43
  t.integer "sort_order"
48
44
  t.datetime "created_at"
49
45
  t.datetime "updated_at"
46
+ t.index ["stripe_id"], name: "index_paid_up_plans_on_stripe_id", unique: true
47
+ t.index ["title"], name: "index_paid_up_plans_on_title", unique: true
50
48
  end
51
49
 
52
- add_index "paid_up_plans", ["stripe_id"], name: "index_paid_up_plans_on_stripe_id", unique: true
53
- add_index "paid_up_plans", ["title"], name: "index_paid_up_plans_on_title", unique: true
54
-
55
50
  create_table "posts", force: :cascade do |t|
56
51
  t.string "user_id"
57
52
  t.string "title"
58
53
  t.boolean "active", default: false, null: false
59
54
  t.datetime "created_at"
60
55
  t.datetime "updated_at"
56
+ t.index ["active"], name: "index_posts_on_active"
57
+ t.index ["user_id"], name: "index_posts_on_user_id"
61
58
  end
62
59
 
63
- add_index "posts", ["active"], name: "index_posts_on_active"
64
- add_index "posts", ["user_id"], name: "index_posts_on_user_id"
65
-
66
60
  create_table "roles", force: :cascade do |t|
67
61
  t.string "name"
68
- t.integer "resource_id"
69
62
  t.string "resource_type"
63
+ t.integer "resource_id"
70
64
  t.datetime "created_at"
71
65
  t.datetime "updated_at"
66
+ t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
67
+ t.index ["name"], name: "index_roles_on_name"
72
68
  end
73
69
 
74
- add_index "roles", ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
75
- add_index "roles", ["name"], name: "index_roles_on_name"
76
-
77
70
  create_table "users", force: :cascade do |t|
78
71
  t.string "name"
79
72
  t.string "email", default: "", null: false
@@ -88,16 +81,14 @@ ActiveRecord::Schema.define(version: 20170220001913) do
88
81
  t.string "last_sign_in_ip"
89
82
  t.string "stripe_id"
90
83
  t.string "coupon_code"
84
+ t.index ["email"], name: "index_users_on_email", unique: true
85
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
91
86
  end
92
87
 
93
- add_index "users", ["email"], name: "index_users_on_email", unique: true
94
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
95
-
96
88
  create_table "users_roles", id: false, force: :cascade do |t|
97
89
  t.integer "user_id"
98
90
  t.integer "role_id"
91
+ t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
99
92
  end
100
93
 
101
- add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
102
-
103
94
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ###############
2
4
  # Plans #
3
5
  ###############
@@ -178,7 +180,7 @@ FactoryGirl.create(
178
180
  plan: no_ads_plan
179
181
  )
180
182
 
181
- group_leader_subscriber = FactoryGirl.create(
183
+ leader_subscriber = FactoryGirl.create(
182
184
  :user,
183
185
  name: 'Group Leader Subscriber',
184
186
  plan: group_leader_plan
@@ -190,7 +192,7 @@ disabling_subscriber = FactoryGirl.create(
190
192
  plan: group_leader_plan
191
193
  )
192
194
 
193
- professional_subscriber = FactoryGirl.create(
195
+ prof_subscriber = FactoryGirl.create(
194
196
  :user,
195
197
  name: 'Professional Subscriber',
196
198
  plan: professional_plan
@@ -216,28 +218,28 @@ past_due_subscriber = FactoryGirl.create(
216
218
  FactoryGirl.create(
217
219
  :group,
218
220
  title: 'First Group',
219
- owner: group_leader_subscriber,
221
+ owner: leader_subscriber,
220
222
  active: true
221
223
  )
222
224
 
223
225
  FactoryGirl.create(
224
226
  :group,
225
227
  title: 'Inactive Group',
226
- owner: group_leader_subscriber,
228
+ owner: leader_subscriber,
227
229
  active: false
228
230
  )
229
231
 
230
232
  FactoryGirl.create(
231
233
  :group,
232
234
  title: 'Second Group',
233
- owner: professional_subscriber,
235
+ owner: prof_subscriber,
234
236
  active: true
235
237
  )
236
238
 
237
239
  FactoryGirl.create(
238
240
  :group,
239
241
  title: 'Third Group',
240
- owner: professional_subscriber,
242
+ owner: prof_subscriber,
241
243
  active: true
242
244
  )
243
245
 
Binary file
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :system do
2
4
  desc 'Recreate database from seeds'
3
5
  task clean: :environment do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :doodad do
3
5
  name 'Test Name'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :group do
3
5
  title 'Test Title'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :plan, class: 'PaidUp::Plan' do
3
5
  title 'Plan Title'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :plan_feature_setting, class: 'PaidUp::PlanFeatureSetting' do
3
5
  feature nil
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :post do
3
5
  title 'Test Title'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryGirl.define do
2
4
  factory :user do
3
5
  sequence :email do |n|
@@ -35,7 +37,7 @@ FactoryGirl.define do
35
37
  ).id
36
38
  trial_end = nil
37
39
  end
38
- user.subscribe_to_plan(evaluator.plan, token, trial_end)
40
+ user.subscribe_to_plan(evaluator.plan, token, nil, trial_end)
39
41
  end
40
42
  end
41
43
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
  require 'cancan/matchers'
3
5
 
@@ -6,18 +8,18 @@ describe Group do
6
8
 
7
9
  describe '#owners' do
8
10
  subject { first_group.owners }
9
- it { should include group_leader_subscriber }
10
- it { should_not include professional_subscriber }
11
+ it { should include leader_subscriber }
12
+ it { should_not include prof_subscriber }
11
13
  end
12
14
 
13
15
  describe '#save_with_owner' do
14
16
  let(:new_group) do
15
17
  group = Group.new(title: 'Saved Group')
16
- .save_with_owner(professional_subscriber)
18
+ .save_with_owner(prof_subscriber)
17
19
  group.reload
18
20
  end
19
21
  subject { new_group.owners }
20
- it { should include professional_subscriber }
22
+ it { should include prof_subscriber }
21
23
  end
22
24
 
23
25
  describe '#owners_enabled_count' do
@@ -42,13 +44,13 @@ describe Group do
42
44
  it { should eq 2 }
43
45
  end
44
46
 
45
- describe '#enabled' do
47
+ describe '#enabled?' do
46
48
  describe 'when true' do
47
- subject { first_group.enabled }
49
+ subject { first_group.enabled? }
48
50
  it { should eq true }
49
51
  end
50
52
  describe 'when false' do
51
- subject { disabled_group.enabled }
53
+ subject { disabled_group.enabled? }
52
54
  it { should eq false }
53
55
  end
54
56
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  describe PaidUp::Feature do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  describe PaidUp::PlanFeatureSetting do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  describe PaidUp::Plan do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
  require 'cancan/matchers'
3
5
 
@@ -10,24 +12,24 @@ describe 'Scopes' do
10
12
  it { should_not include inactive_post }
11
13
  end
12
14
 
13
- describe 'paid_for#enabled' do
15
+ describe 'paid_for#enabled?' do
14
16
  describe 'when it is within the limit' do
15
- subject { still_enabled_post.enabled }
17
+ subject { still_enabled_post.enabled? }
16
18
  it { should be true }
17
19
  end
18
20
  describe 'when it is NOT within the limit' do
19
- subject { no_longer_enabled_post.enabled }
21
+ subject { no_longer_enabled_post.enabled? }
20
22
  it { should be false }
21
23
  end
22
24
  end
23
25
 
24
- describe 'user#table_rows' do
25
- subject { free_subscriber.table_rows('posts') }
26
+ describe "user#table_setting('posts')#rows_count" do
27
+ subject { free_subscriber.table_setting('posts').rows_count }
26
28
  it { should eq 4 }
27
29
  end
28
30
 
29
- describe 'user#rolify_rows' do
30
- subject { group_leader_subscriber.rolify_rows('groups') }
31
+ describe "user#table_setting('groups')#rows_count" do
32
+ subject { leader_subscriber.rolify_setting('groups').rows_count }
31
33
  it { should eq 1 }
32
34
  end
33
35
  end