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.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -13
- data/.rubocop_todo.yml +7 -0
- data/.travis.yml +4 -3
- data/Gemfile +29 -24
- data/README.md +22 -1
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/app/controllers/paid_up/paid_up_controller.rb +16 -9
- data/app/controllers/paid_up/plans_controller.rb +2 -0
- data/app/controllers/paid_up/subscriptions_controller.rb +58 -49
- data/app/helpers/paid_up/features_helper.rb +35 -34
- data/app/helpers/paid_up/paid_up_helper.rb +10 -8
- data/app/helpers/paid_up/plans_helper.rb +75 -55
- data/app/helpers/paid_up/subscriptions_helper.rb +17 -13
- data/app/models/paid_up/ability.rb +53 -46
- data/app/models/paid_up/plan.rb +36 -34
- data/app/models/paid_up/plan_feature_setting.rb +2 -0
- data/app/models/paid_up/unlimited.rb +2 -0
- data/app/views/paid_up/features/_abilities_table.html.haml +1 -45
- data/app/views/paid_up/features/_boolean_state.html.haml +6 -0
- data/app/views/paid_up/features/_setting_state.html.haml +13 -0
- data/app/views/paid_up/subscriptions/index.html.haml +2 -2
- data/config/initializers/stripe.rb +2 -0
- data/config/locales/en.yml +4 -1
- data/config/routes.rb +3 -1
- data/lib/generators/paid_up/install/install_generator.rb +4 -1
- data/lib/generators/paid_up/install/templates/ability.rb +2 -0
- data/lib/generators/paid_up/install/templates/initializer.rb +2 -0
- data/lib/generators/paid_up/utils.rb +2 -0
- data/lib/paid_up/configuration.rb +4 -2
- data/lib/paid_up/engine.rb +2 -0
- data/lib/paid_up/extensions/integer.rb +2 -0
- data/lib/paid_up/extensions/stripe.rb +2 -0
- data/lib/paid_up/feature.rb +10 -7
- data/lib/paid_up/feature_setting_type.rb +45 -0
- data/lib/paid_up/feature_setting_types/rolify.rb +10 -0
- data/lib/paid_up/feature_setting_types/table.rb +7 -0
- data/lib/paid_up/localization.rb +2 -0
- data/lib/paid_up/mixins/paid_for.rb +59 -47
- data/lib/paid_up/mixins/subscriber.rb +45 -101
- data/lib/paid_up/railtie.rb +2 -0
- data/lib/paid_up/ruby_version_check.rb +15 -0
- data/lib/paid_up/subscription.rb +80 -0
- data/lib/paid_up/validators/rolify_rows.rb +11 -6
- data/lib/paid_up/validators/table_rows.rb +9 -6
- data/lib/paid_up/version.rb +2 -0
- data/lib/paid_up.rb +8 -0
- data/paid_up.gemspec +108 -115
- data/spec/controllers/paid_up/plans_spec.rb +2 -0
- data/spec/controllers/paid_up/subscriptions_spec.rb +18 -11
- data/spec/dummy/Rakefile +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css.scss +6 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/models/ability.rb +2 -0
- data/spec/dummy/app/models/doodad.rb +2 -0
- data/spec/dummy/app/models/group.rb +2 -0
- data/spec/dummy/app/models/post.rb +2 -0
- data/spec/dummy/app/models/role.rb +2 -0
- data/spec/dummy/app/models/user.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.haml +13 -11
- data/spec/dummy/bin/bundle +2 -0
- data/spec/dummy/bin/rails +2 -0
- data/spec/dummy/bin/rake +2 -0
- data/spec/dummy/bin/setup +10 -8
- data/spec/dummy/config/application.rb +2 -3
- data/spec/dummy/config/boot.rb +2 -0
- data/spec/dummy/config/environment.rb +2 -0
- data/spec/dummy/config/environments/development.rb +2 -0
- data/spec/dummy/config/environments/test.rb +2 -4
- data/spec/dummy/config/initializers/assets.rb +2 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +1 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
- data/spec/dummy/config/initializers/devise.rb +2 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +2 -0
- data/spec/dummy/config/initializers/inflections.rb +1 -0
- data/spec/dummy/config/initializers/mime_types.rb +1 -0
- data/spec/dummy/config/initializers/paid_up.rb +10 -16
- data/spec/dummy/config/initializers/rolify.rb +2 -0
- data/spec/dummy/config/initializers/session_store.rb +2 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/dummy/config.ru +2 -0
- data/spec/dummy/db/schema.rb +14 -23
- data/spec/dummy/db/seeds.rb +8 -6
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/tasks/system.rake +2 -0
- data/spec/factories/doodad.rb +2 -0
- data/spec/factories/group.rb +2 -0
- data/spec/factories/plan.rb +2 -0
- data/spec/factories/plan_feature_setting.rb +2 -0
- data/spec/factories/post.rb +2 -0
- data/spec/factories/user.rb +3 -1
- data/spec/models/group_spec.rb +9 -7
- data/spec/models/paid_up/feature_spec.rb +2 -0
- data/spec/models/paid_up/plan_feature_setting_spec.rb +2 -0
- data/spec/models/paid_up/plan_spec.rb +2 -0
- data/spec/models/scope_spec.rb +9 -7
- data/spec/models/user_spec.rb +60 -58
- data/spec/paid_up_spec.rb +2 -0
- data/spec/rails_helper.rb +16 -2
- data/spec/routing/paid_up/plans_spec.rb +2 -0
- data/spec/routing/paid_up/subscription_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/support/controller_macros.rb +2 -0
- data/spec/support/factory_girl.rb +2 -0
- data/spec/support/loaded_site/features.rb +2 -0
- data/spec/support/loaded_site/groups.rb +2 -0
- data/spec/support/loaded_site/loaded_site.rb +2 -0
- data/spec/support/loaded_site/plans.rb +2 -0
- data/spec/support/loaded_site/posts.rb +2 -0
- data/spec/support/loaded_site/users.rb +4 -2
- data/spec/support/stripe.rb +2 -0
- data/spec/views/paid_up/plans_spec.rb +9 -7
- data/spec/views/paid_up/subscriptions_spec.rb +20 -19
- metadata +124 -90
- data/app/views/devise/confirmations/new.html.haml +0 -13
- data/app/views/devise/passwords/edit.html.haml +0 -19
- data/app/views/devise/passwords/new.html.haml +0 -14
- data/app/views/devise/registrations/_new_form.html.haml +0 -23
- data/app/views/devise/registrations/edit.html.haml +0 -39
- data/app/views/devise/registrations/new.html.haml +0 -11
- data/app/views/devise/sessions/_new_form.html.haml +0 -21
- data/app/views/devise/sessions/new.html.haml +0 -11
- data/app/views/devise/shared/_links.html.haml +0 -14
- data/app/views/devise/unlocks/new.html.haml +0 -14
- data/app/views/layouts/mailer.html.haml +0 -3
- data/app/views/layouts/mailer.text.haml +0 -1
- data/app/views/paid_up/subscription_mailer/payment_failed_email.html.haml +0 -0
- data/app/views/paid_up/subscription_mailer/payment_failed_email.text.haml +0 -0
- data/coverage/.last_run.json +0 -5
- data/coverage/.resultset.json +0 -1927
- data/spec/dummy/app/views/pages/index.html.haml +0 -1
- data/spec/dummy/config/environments/production.rb +0 -83
- data/spec/dummy/config/initializers/high_voltage.rb +0 -3
data/paid_up.gemspec
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
# Generated by
|
1
|
+
# Generated by juwelier
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit
|
3
|
+
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: paid_up 0.
|
5
|
+
# stub: paid_up 0.12.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name = "paid_up"
|
9
|
-
s.version = "0.
|
8
|
+
s.name = "paid_up".freeze
|
9
|
+
s.version = "0.12.3"
|
10
10
|
|
11
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
-
s.require_paths = ["lib"]
|
13
|
-
s.authors = ["Karen Lundgren"]
|
14
|
-
s.date = "2017-
|
15
|
-
s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features."
|
16
|
-
s.email = "karen.e.lundgren@gmail.com"
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Karen Lundgren".freeze]
|
14
|
+
s.date = "2017-04-06"
|
15
|
+
s.description = "Allows a model of your choosing (such as users) to subscribe to a plan, which enables features.".freeze
|
16
|
+
s.email = "karen.e.lundgren@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE.txt",
|
19
19
|
"README.md"
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = [
|
22
22
|
".rspec",
|
23
23
|
".rubocop.yml",
|
24
|
+
".rubocop_todo.yml",
|
24
25
|
".travis.yml",
|
25
26
|
"Gemfile",
|
26
27
|
"LICENSE.txt",
|
@@ -39,31 +40,17 @@ Gem::Specification.new do |s|
|
|
39
40
|
"app/models/paid_up/plan.rb",
|
40
41
|
"app/models/paid_up/plan_feature_setting.rb",
|
41
42
|
"app/models/paid_up/unlimited.rb",
|
42
|
-
"app/views/devise/confirmations/new.html.haml",
|
43
|
-
"app/views/devise/passwords/edit.html.haml",
|
44
|
-
"app/views/devise/passwords/new.html.haml",
|
45
|
-
"app/views/devise/registrations/_new_form.html.haml",
|
46
|
-
"app/views/devise/registrations/edit.html.haml",
|
47
|
-
"app/views/devise/registrations/new.html.haml",
|
48
|
-
"app/views/devise/sessions/_new_form.html.haml",
|
49
|
-
"app/views/devise/sessions/new.html.haml",
|
50
|
-
"app/views/devise/shared/_links.html.haml",
|
51
|
-
"app/views/devise/unlocks/new.html.haml",
|
52
|
-
"app/views/layouts/mailer.html.haml",
|
53
|
-
"app/views/layouts/mailer.text.haml",
|
54
43
|
"app/views/paid_up/features/_abilities_table.html.haml",
|
44
|
+
"app/views/paid_up/features/_boolean_state.html.haml",
|
45
|
+
"app/views/paid_up/features/_setting_state.html.haml",
|
55
46
|
"app/views/paid_up/features/_table.html.haml",
|
56
47
|
"app/views/paid_up/layouts/_google_analytics_data_layer.html.haml",
|
57
48
|
"app/views/paid_up/plans/index.html.haml",
|
58
|
-
"app/views/paid_up/subscription_mailer/payment_failed_email.html.haml",
|
59
|
-
"app/views/paid_up/subscription_mailer/payment_failed_email.text.haml",
|
60
49
|
"app/views/paid_up/subscriptions/index.html.haml",
|
61
50
|
"app/views/paid_up/subscriptions/new.html.haml",
|
62
51
|
"config/initializers/stripe.rb",
|
63
52
|
"config/locales/en.yml",
|
64
53
|
"config/routes.rb",
|
65
|
-
"coverage/.last_run.json",
|
66
|
-
"coverage/.resultset.json",
|
67
54
|
"coverage/.resultset.json.lock",
|
68
55
|
"db/migrate/20150407110101_create_paid_up_plans_table.rb",
|
69
56
|
"db/migrate/20150519164237_add_stripe_id_column_to_users.rb",
|
@@ -79,10 +66,15 @@ Gem::Specification.new do |s|
|
|
79
66
|
"lib/paid_up/extensions/integer.rb",
|
80
67
|
"lib/paid_up/extensions/stripe.rb",
|
81
68
|
"lib/paid_up/feature.rb",
|
69
|
+
"lib/paid_up/feature_setting_type.rb",
|
70
|
+
"lib/paid_up/feature_setting_types/rolify.rb",
|
71
|
+
"lib/paid_up/feature_setting_types/table.rb",
|
82
72
|
"lib/paid_up/localization.rb",
|
83
73
|
"lib/paid_up/mixins/paid_for.rb",
|
84
74
|
"lib/paid_up/mixins/subscriber.rb",
|
85
75
|
"lib/paid_up/railtie.rb",
|
76
|
+
"lib/paid_up/ruby_version_check.rb",
|
77
|
+
"lib/paid_up/subscription.rb",
|
86
78
|
"lib/paid_up/validators/rolify_rows.rb",
|
87
79
|
"lib/paid_up/validators/table_rows.rb",
|
88
80
|
"lib/paid_up/version.rb",
|
@@ -100,7 +92,6 @@ Gem::Specification.new do |s|
|
|
100
92
|
"spec/dummy/app/models/role.rb",
|
101
93
|
"spec/dummy/app/models/user.rb",
|
102
94
|
"spec/dummy/app/views/layouts/application.html.haml",
|
103
|
-
"spec/dummy/app/views/pages/index.html.haml",
|
104
95
|
"spec/dummy/bin/bundle",
|
105
96
|
"spec/dummy/bin/rails",
|
106
97
|
"spec/dummy/bin/rake",
|
@@ -111,14 +102,12 @@ Gem::Specification.new do |s|
|
|
111
102
|
"spec/dummy/config/database.yml",
|
112
103
|
"spec/dummy/config/environment.rb",
|
113
104
|
"spec/dummy/config/environments/development.rb",
|
114
|
-
"spec/dummy/config/environments/production.rb",
|
115
105
|
"spec/dummy/config/environments/test.rb",
|
116
106
|
"spec/dummy/config/initializers/assets.rb",
|
117
107
|
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
118
108
|
"spec/dummy/config/initializers/cookies_serializer.rb",
|
119
109
|
"spec/dummy/config/initializers/devise.rb",
|
120
110
|
"spec/dummy/config/initializers/filter_parameter_logging.rb",
|
121
|
-
"spec/dummy/config/initializers/high_voltage.rb",
|
122
111
|
"spec/dummy/config/initializers/inflections.rb",
|
123
112
|
"spec/dummy/config/initializers/mime_types.rb",
|
124
113
|
"spec/dummy/config/initializers/paid_up.rb",
|
@@ -145,6 +134,7 @@ Gem::Specification.new do |s|
|
|
145
134
|
"spec/dummy/db/migrate/20170220001913_add_active_column_to_groups.rb",
|
146
135
|
"spec/dummy/db/schema.rb",
|
147
136
|
"spec/dummy/db/seeds.rb",
|
137
|
+
"spec/dummy/db/test.sqlite3",
|
148
138
|
"spec/dummy/lib/assets/.keep",
|
149
139
|
"spec/dummy/lib/tasks/system.rake",
|
150
140
|
"spec/dummy/log/.keep",
|
@@ -189,99 +179,102 @@ Gem::Specification.new do |s|
|
|
189
179
|
"spec/views/paid_up/plans_spec.rb",
|
190
180
|
"spec/views/paid_up/subscriptions_spec.rb"
|
191
181
|
]
|
192
|
-
s.homepage = "http://www.gemvein.com/museum/cases/paid_up"
|
193
|
-
s.licenses = ["MIT"]
|
194
|
-
s.rubygems_version = "2.
|
195
|
-
s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features."
|
182
|
+
s.homepage = "http://www.gemvein.com/museum/cases/paid_up".freeze
|
183
|
+
s.licenses = ["MIT".freeze]
|
184
|
+
s.rubygems_version = "2.6.11".freeze
|
185
|
+
s.summary = "Allows a model of your choosing to subscribe to a plan, which enables features.".freeze
|
196
186
|
|
197
187
|
if s.respond_to? :specification_version then
|
198
188
|
s.specification_version = 4
|
199
189
|
|
200
190
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
201
|
-
s.add_runtime_dependency(%q<rails
|
202
|
-
s.add_runtime_dependency(%q<rails
|
203
|
-
s.add_runtime_dependency(%q<
|
204
|
-
s.add_runtime_dependency(%q<
|
205
|
-
s.add_runtime_dependency(%q<uglifier
|
206
|
-
s.add_runtime_dependency(%q<bootstrap_leather
|
207
|
-
s.add_runtime_dependency(%q<chronic
|
208
|
-
s.add_runtime_dependency(%q<money
|
209
|
-
s.add_runtime_dependency(%q<
|
210
|
-
s.add_runtime_dependency(%q<
|
211
|
-
s.add_runtime_dependency(%q<rolify
|
212
|
-
s.add_runtime_dependency(%q<stripe
|
213
|
-
s.add_development_dependency(%q<dotenv-rails
|
214
|
-
s.add_development_dependency(%q<
|
215
|
-
s.add_development_dependency(%q<
|
216
|
-
s.add_development_dependency(%q<
|
217
|
-
s.add_development_dependency(%q<
|
218
|
-
s.add_development_dependency(%q<
|
219
|
-
s.add_development_dependency(%q<
|
220
|
-
s.add_development_dependency(%q<scss_lint
|
221
|
-
s.add_development_dependency(%q<
|
222
|
-
s.add_development_dependency(%q<
|
223
|
-
s.add_development_dependency(%q<
|
224
|
-
s.add_development_dependency(%q<
|
225
|
-
s.add_development_dependency(%q<
|
226
|
-
s.add_development_dependency(%q<rspec-rails
|
227
|
-
s.add_development_dependency(%q<
|
191
|
+
s.add_runtime_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
|
192
|
+
s.add_runtime_dependency(%q<jquery-rails>.freeze, ["~> 4"])
|
193
|
+
s.add_runtime_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
|
194
|
+
s.add_runtime_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
|
195
|
+
s.add_runtime_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
|
196
|
+
s.add_runtime_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
|
197
|
+
s.add_runtime_dependency(%q<chronic>.freeze, ["~> 0.10"])
|
198
|
+
s.add_runtime_dependency(%q<money>.freeze, ["~> 6.5"])
|
199
|
+
s.add_runtime_dependency(%q<cancancan>.freeze, ["~> 1"])
|
200
|
+
s.add_runtime_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
|
201
|
+
s.add_runtime_dependency(%q<rolify>.freeze, ["~> 5"])
|
202
|
+
s.add_runtime_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
|
203
|
+
s.add_development_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
|
204
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 1"])
|
205
|
+
s.add_development_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
|
206
|
+
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2"])
|
207
|
+
s.add_development_dependency(%q<nokogiri>.freeze, [">= 1.7"])
|
208
|
+
s.add_development_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
|
209
|
+
s.add_development_dependency(%q<rubocop>.freeze, [">= 0"])
|
210
|
+
s.add_development_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
|
211
|
+
s.add_development_dependency(%q<web-console>.freeze, ["~> 3"])
|
212
|
+
s.add_development_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
|
213
|
+
s.add_development_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
|
214
|
+
s.add_development_dependency(%q<forgery>.freeze, ["~> 0.6"])
|
215
|
+
s.add_development_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
|
216
|
+
s.add_development_dependency(%q<rspec-rails>.freeze, ["~> 3"])
|
217
|
+
s.add_development_dependency(%q<sass-rails>.freeze, ["~> 5"])
|
218
|
+
s.add_development_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
228
219
|
else
|
229
|
-
s.add_dependency(%q<rails
|
230
|
-
s.add_dependency(%q<rails
|
231
|
-
s.add_dependency(%q<
|
232
|
-
s.add_dependency(%q<
|
233
|
-
s.add_dependency(%q<uglifier
|
234
|
-
s.add_dependency(%q<bootstrap_leather
|
235
|
-
s.add_dependency(%q<chronic
|
236
|
-
s.add_dependency(%q<money
|
237
|
-
s.add_dependency(%q<
|
238
|
-
s.add_dependency(%q<
|
239
|
-
s.add_dependency(%q<rolify
|
240
|
-
s.add_dependency(%q<stripe
|
241
|
-
s.add_dependency(%q<dotenv-rails
|
242
|
-
s.add_dependency(%q<
|
243
|
-
s.add_dependency(%q<
|
244
|
-
s.add_dependency(%q<
|
245
|
-
s.add_dependency(%q<
|
246
|
-
s.add_dependency(%q<
|
247
|
-
s.add_dependency(%q<
|
248
|
-
s.add_dependency(%q<scss_lint
|
249
|
-
s.add_dependency(%q<
|
250
|
-
s.add_dependency(%q<
|
251
|
-
s.add_dependency(%q<
|
252
|
-
s.add_dependency(%q<
|
253
|
-
s.add_dependency(%q<
|
254
|
-
s.add_dependency(%q<rspec-rails
|
255
|
-
s.add_dependency(%q<
|
220
|
+
s.add_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
|
221
|
+
s.add_dependency(%q<jquery-rails>.freeze, ["~> 4"])
|
222
|
+
s.add_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
|
223
|
+
s.add_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
|
224
|
+
s.add_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
|
225
|
+
s.add_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
|
226
|
+
s.add_dependency(%q<chronic>.freeze, ["~> 0.10"])
|
227
|
+
s.add_dependency(%q<money>.freeze, ["~> 6.5"])
|
228
|
+
s.add_dependency(%q<cancancan>.freeze, ["~> 1"])
|
229
|
+
s.add_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
|
230
|
+
s.add_dependency(%q<rolify>.freeze, ["~> 5"])
|
231
|
+
s.add_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
|
232
|
+
s.add_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
|
233
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1"])
|
234
|
+
s.add_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
|
235
|
+
s.add_dependency(%q<juwelier>.freeze, ["~> 2"])
|
236
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.7"])
|
237
|
+
s.add_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
|
238
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
239
|
+
s.add_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
|
240
|
+
s.add_dependency(%q<web-console>.freeze, ["~> 3"])
|
241
|
+
s.add_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
|
242
|
+
s.add_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
|
243
|
+
s.add_dependency(%q<forgery>.freeze, ["~> 0.6"])
|
244
|
+
s.add_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
|
245
|
+
s.add_dependency(%q<rspec-rails>.freeze, ["~> 3"])
|
246
|
+
s.add_dependency(%q<sass-rails>.freeze, ["~> 5"])
|
247
|
+
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
256
248
|
end
|
257
249
|
else
|
258
|
-
s.add_dependency(%q<rails
|
259
|
-
s.add_dependency(%q<rails
|
260
|
-
s.add_dependency(%q<
|
261
|
-
s.add_dependency(%q<
|
262
|
-
s.add_dependency(%q<uglifier
|
263
|
-
s.add_dependency(%q<bootstrap_leather
|
264
|
-
s.add_dependency(%q<chronic
|
265
|
-
s.add_dependency(%q<money
|
266
|
-
s.add_dependency(%q<
|
267
|
-
s.add_dependency(%q<
|
268
|
-
s.add_dependency(%q<rolify
|
269
|
-
s.add_dependency(%q<stripe
|
270
|
-
s.add_dependency(%q<dotenv-rails
|
271
|
-
s.add_dependency(%q<
|
272
|
-
s.add_dependency(%q<
|
273
|
-
s.add_dependency(%q<
|
274
|
-
s.add_dependency(%q<
|
275
|
-
s.add_dependency(%q<
|
276
|
-
s.add_dependency(%q<
|
277
|
-
s.add_dependency(%q<scss_lint
|
278
|
-
s.add_dependency(%q<
|
279
|
-
s.add_dependency(%q<
|
280
|
-
s.add_dependency(%q<
|
281
|
-
s.add_dependency(%q<
|
282
|
-
s.add_dependency(%q<
|
283
|
-
s.add_dependency(%q<rspec-rails
|
284
|
-
s.add_dependency(%q<
|
250
|
+
s.add_dependency(%q<haml-rails>.freeze, ["~> 0.9"])
|
251
|
+
s.add_dependency(%q<jquery-rails>.freeze, ["~> 4"])
|
252
|
+
s.add_dependency(%q<rails>.freeze, ["< 6", ">= 4"])
|
253
|
+
s.add_dependency(%q<rails-i18n>.freeze, ["< 6", ">= 4"])
|
254
|
+
s.add_dependency(%q<uglifier>.freeze, ["< 4", ">= 2.7"])
|
255
|
+
s.add_dependency(%q<bootstrap_leather>.freeze, ["~> 0.9"])
|
256
|
+
s.add_dependency(%q<chronic>.freeze, ["~> 0.10"])
|
257
|
+
s.add_dependency(%q<money>.freeze, ["~> 6.5"])
|
258
|
+
s.add_dependency(%q<cancancan>.freeze, ["~> 1"])
|
259
|
+
s.add_dependency(%q<devise>.freeze, ["< 5", ">= 3.4"])
|
260
|
+
s.add_dependency(%q<rolify>.freeze, ["~> 5"])
|
261
|
+
s.add_dependency(%q<stripe>.freeze, ["< 3", ">= 1.36"])
|
262
|
+
s.add_dependency(%q<dotenv-rails>.freeze, ["~> 2.2"])
|
263
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 1"])
|
264
|
+
s.add_dependency(%q<coffeelint>.freeze, ["~> 1.14"])
|
265
|
+
s.add_dependency(%q<juwelier>.freeze, ["~> 2"])
|
266
|
+
s.add_dependency(%q<nokogiri>.freeze, [">= 1.7"])
|
267
|
+
s.add_dependency(%q<pre-commit>.freeze, ["~> 0.32"])
|
268
|
+
s.add_dependency(%q<rubocop>.freeze, [">= 0"])
|
269
|
+
s.add_dependency(%q<scss_lint>.freeze, ["~> 0.52.0"])
|
270
|
+
s.add_dependency(%q<web-console>.freeze, ["~> 3"])
|
271
|
+
s.add_dependency(%q<bootstrap-sass>.freeze, ["~> 3"])
|
272
|
+
s.add_dependency(%q<factory_girl_rails>.freeze, ["~> 4.5"])
|
273
|
+
s.add_dependency(%q<forgery>.freeze, ["~> 0.6"])
|
274
|
+
s.add_dependency(%q<rails-controller-testing>.freeze, ["~> 1"])
|
275
|
+
s.add_dependency(%q<rspec-rails>.freeze, ["~> 3"])
|
276
|
+
s.add_dependency(%q<sass-rails>.freeze, ["~> 5"])
|
277
|
+
s.add_dependency(%q<sqlite3>.freeze, ["~> 1.3"])
|
285
278
|
end
|
286
279
|
end
|
287
280
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails_helper'
|
2
4
|
|
3
5
|
RSpec.describe PaidUp::SubscriptionsController do
|
@@ -37,7 +39,7 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
37
39
|
describe 'when the user is anonymous' do
|
38
40
|
before do
|
39
41
|
access_anonymous
|
40
|
-
get :new, plan_id: professional_plan.id
|
42
|
+
get :new, params: { plan_id: professional_plan.id }
|
41
43
|
end
|
42
44
|
describe 'redirects to the user sign up page' do
|
43
45
|
subject { response }
|
@@ -50,7 +52,7 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
50
52
|
describe 'with a paid plan' do
|
51
53
|
before do
|
52
54
|
sign_in free_subscriber
|
53
|
-
get :new, plan_id: professional_plan.id
|
55
|
+
get :new, params: { plan_id: professional_plan.id }
|
54
56
|
end
|
55
57
|
after do
|
56
58
|
free_subscriber.subscribe_to_plan free_plan
|
@@ -72,7 +74,7 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
72
74
|
describe 'with the free plan' do
|
73
75
|
before do
|
74
76
|
login_subscriber no_ads_subscriber
|
75
|
-
get :new, plan_id: free_plan.id
|
77
|
+
get :new, params: { plan_id: free_plan.id }
|
76
78
|
end
|
77
79
|
after do
|
78
80
|
no_ads_subscriber.subscribe_to_plan no_ads_plan
|
@@ -93,11 +95,11 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
93
95
|
end
|
94
96
|
describe 'when downgrading' do
|
95
97
|
before do
|
96
|
-
sign_in
|
97
|
-
get :new, plan_id: no_ads_plan.id
|
98
|
+
sign_in prof_subscriber
|
99
|
+
get :new, params: { plan_id: no_ads_plan.id }
|
98
100
|
end
|
99
101
|
after do
|
100
|
-
|
102
|
+
prof_subscriber.subscribe_to_plan professional_plan
|
101
103
|
end
|
102
104
|
describe 'redirects to the subscriptions index page' do
|
103
105
|
subject { response }
|
@@ -135,7 +137,10 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
135
137
|
before do
|
136
138
|
sign_in free_subscriber
|
137
139
|
token = working_stripe_token free_subscriber
|
138
|
-
post
|
140
|
+
post(
|
141
|
+
:create,
|
142
|
+
params: { plan_id: professional_plan.id, stripeToken: token }
|
143
|
+
)
|
139
144
|
end
|
140
145
|
after do
|
141
146
|
free_subscriber.subscribe_to_plan free_plan
|
@@ -160,9 +165,11 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
160
165
|
token = working_stripe_token free_subscriber
|
161
166
|
post(
|
162
167
|
:create,
|
163
|
-
|
164
|
-
|
165
|
-
|
168
|
+
params: {
|
169
|
+
plan_id: professional_plan.id,
|
170
|
+
stripeToken: token,
|
171
|
+
coupon_code: '25OFF'
|
172
|
+
}
|
166
173
|
)
|
167
174
|
end
|
168
175
|
after do
|
@@ -187,7 +194,7 @@ RSpec.describe PaidUp::SubscriptionsController do
|
|
187
194
|
describe 'without a coupon code' do
|
188
195
|
before do
|
189
196
|
sign_in no_ads_subscriber
|
190
|
-
post :create, plan_id: professional_plan.id
|
197
|
+
post :create, params: { plan_id: professional_plan.id }
|
191
198
|
end
|
192
199
|
after do
|
193
200
|
no_ads_subscriber.subscribe_to_plan no_ads_plan
|
data/spec/dummy/Rakefile
CHANGED
@@ -18,15 +18,17 @@
|
|
18
18
|
= yield
|
19
19
|
|
20
20
|
%footer
|
21
|
-
|
22
|
-
.
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
21
|
+
.container
|
22
|
+
.row
|
23
|
+
- add_widget do
|
24
|
+
.clearfix
|
25
|
+
= nav_list class: 'nav-pills nav-stacked' do
|
26
|
+
= nav_item :plans.l, paid_up.plans_path
|
27
|
+
- if signed_in?
|
28
|
+
= nav_item :my_subscription.l, paid_up.subscriptions_path
|
29
|
+
= nav_item :sign_out.l, main_app.destroy_user_session_path, method: :delete
|
30
|
+
- else
|
31
|
+
= nav_item :sign_in.l, main_app.new_user_session_path
|
32
|
+
= nav_item :sign_up.l, main_app.new_user_registration_path
|
33
|
+
= render_widgets 'md', 3
|
32
34
|
= render_footer_javascript
|
data/spec/dummy/bin/bundle
CHANGED
data/spec/dummy/bin/rails
CHANGED
data/spec/dummy/bin/rake
CHANGED
data/spec/dummy/bin/setup
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'pathname'
|
3
5
|
|
4
6
|
# path to your application root.
|
5
|
-
APP_ROOT = Pathname.new File.expand_path('../../',
|
7
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
8
|
|
7
9
|
Dir.chdir APP_ROOT do
|
8
10
|
# This script is a starting point to setup your application.
|
9
11
|
# Add necessary setup steps to this file:
|
10
12
|
|
11
|
-
puts
|
12
|
-
system
|
13
|
-
system
|
13
|
+
puts '== Installing dependencies =='
|
14
|
+
system 'gem install bundler --conservative'
|
15
|
+
system 'bundle check || bundle install'
|
14
16
|
|
15
17
|
# puts "\n== Copying sample files =="
|
16
18
|
# unless File.exist?("config/database.yml")
|
@@ -18,12 +20,12 @@ Dir.chdir APP_ROOT do
|
|
18
20
|
# end
|
19
21
|
|
20
22
|
puts "\n== Preparing database =="
|
21
|
-
system
|
23
|
+
system 'bin/rake db:setup'
|
22
24
|
|
23
25
|
puts "\n== Removing old logs and tempfiles =="
|
24
|
-
system
|
25
|
-
system
|
26
|
+
system 'rm -f log/*'
|
27
|
+
system 'rm -rf tmp/cache'
|
26
28
|
|
27
29
|
puts "\n== Restarting application server =="
|
28
|
-
system
|
30
|
+
system 'touch tmp/restart.txt'
|
29
31
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require File.expand_path('../boot', __FILE__)
|
2
4
|
|
3
5
|
# Pick the frameworks you want:
|
@@ -29,9 +31,6 @@ module Dummy
|
|
29
31
|
# ]
|
30
32
|
# config.i18n.default_locale = :de
|
31
33
|
|
32
|
-
# Do not swallow errors in after_commit/after_rollback callbacks.
|
33
|
-
config.active_record.raise_in_transactional_callbacks = true
|
34
|
-
|
35
34
|
config.generators do |g|
|
36
35
|
g.hidden_namespaces << 'test_unit' << 'erb'
|
37
36
|
g.orm :active_record
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Rails.application.configure do
|
2
4
|
# Settings specified here will take precedence over those in
|
3
5
|
# config/application.rb.
|
@@ -13,10 +15,6 @@ Rails.application.configure do
|
|
13
15
|
# preloads Rails for running tests, you may have to set it to true.
|
14
16
|
config.eager_load = false
|
15
17
|
|
16
|
-
# Configure static file server for tests with Cache-Control for performance.
|
17
|
-
config.serve_static_files = true
|
18
|
-
config.static_cache_control = 'public, max-age=3600'
|
19
|
-
|
20
18
|
# Show full error reports and disable caching.
|
21
19
|
config.consider_all_requests_local = true
|
22
20
|
config.action_controller.perform_caching = false
|