effective_orders 3.0.0 → 3.0.1

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.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/effective_orders/version.rb +1 -1
  4. metadata +10 -258
  5. data/spec/controllers/admin/orders_controller_spec.rb +0 -243
  6. data/spec/controllers/carts_controller_spec.rb +0 -143
  7. data/spec/controllers/ccbill_orders_controller_spec.rb +0 -103
  8. data/spec/controllers/moneris_orders_controller_spec.rb +0 -133
  9. data/spec/controllers/orders_controller_spec.rb +0 -500
  10. data/spec/controllers/stripe_orders_controller_spec.rb +0 -128
  11. data/spec/controllers/webhooks_controller_spec.rb +0 -170
  12. data/spec/dummy/README.rdoc +0 -8
  13. data/spec/dummy/Rakefile +0 -6
  14. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  15. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  16. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  17. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  18. data/spec/dummy/app/models/product.rb +0 -9
  19. data/spec/dummy/app/models/product_with_float_price.rb +0 -9
  20. data/spec/dummy/app/models/user.rb +0 -11
  21. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  22. data/spec/dummy/bin/bundle +0 -3
  23. data/spec/dummy/bin/rails +0 -4
  24. data/spec/dummy/bin/rake +0 -4
  25. data/spec/dummy/config.ru +0 -4
  26. data/spec/dummy/config/application.rb +0 -32
  27. data/spec/dummy/config/boot.rb +0 -5
  28. data/spec/dummy/config/database.yml +0 -25
  29. data/spec/dummy/config/environment.rb +0 -5
  30. data/spec/dummy/config/environments/development.rb +0 -37
  31. data/spec/dummy/config/environments/production.rb +0 -80
  32. data/spec/dummy/config/environments/test.rb +0 -36
  33. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  34. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  35. data/spec/dummy/config/initializers/devise.rb +0 -254
  36. data/spec/dummy/config/initializers/effective_addresses.rb +0 -15
  37. data/spec/dummy/config/initializers/effective_orders.rb +0 -269
  38. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  39. data/spec/dummy/config/initializers/inflections.rb +0 -16
  40. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  41. data/spec/dummy/config/initializers/session_store.rb +0 -3
  42. data/spec/dummy/config/initializers/simple_form.rb +0 -189
  43. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  44. data/spec/dummy/config/locales/en.yml +0 -23
  45. data/spec/dummy/config/routes.rb +0 -3
  46. data/spec/dummy/config/secrets.yml +0 -22
  47. data/spec/dummy/db/schema.rb +0 -158
  48. data/spec/dummy/db/test.sqlite3 +0 -0
  49. data/spec/dummy/log/development.log +0 -164
  50. data/spec/dummy/log/test.log +0 -60
  51. data/spec/dummy/public/404.html +0 -67
  52. data/spec/dummy/public/422.html +0 -67
  53. data/spec/dummy/public/500.html +0 -66
  54. data/spec/dummy/public/favicon.ico +0 -0
  55. data/spec/fixtures/stripe_webhooks/invoice.payment_succeeded.without_renewals.json +0 -76
  56. data/spec/helpers/effective_orders_helper_spec.rb +0 -21
  57. data/spec/models/acts_as_purchasable_spec.rb +0 -75
  58. data/spec/models/customer_spec.rb +0 -72
  59. data/spec/models/factories_spec.rb +0 -35
  60. data/spec/models/order_item_spec.rb +0 -35
  61. data/spec/models/order_spec.rb +0 -445
  62. data/spec/models/stripe_charge_spec.rb +0 -39
  63. data/spec/models/subscription_spec.rb +0 -103
  64. data/spec/spec_helper.rb +0 -46
  65. data/spec/support/factories.rb +0 -139
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- #
7
- default: &default
8
- adapter: sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- development:
13
- <<: *default
14
- database: db/development.sqlite3
15
-
16
- # Warning: The database defined as "test" will be erased and
17
- # re-generated from your development database when you run "rake".
18
- # Do not set this db to the same as development or production.
19
- test:
20
- <<: *default
21
- database: db/test.sqlite3
22
-
23
- production:
24
- <<: *default
25
- database: db/production.sqlite3
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Rails.application.initialize!
@@ -1,37 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Raise an error on page load if there are pending migrations.
23
- config.active_record.migration_error = :page_load
24
-
25
- # Debug mode disables concatenation and preprocessing of assets.
26
- # This option may cause significant delays in view rendering with a large
27
- # number of complex assets.
28
- config.assets.debug = true
29
-
30
- # Adds additional error checking when serving assets at runtime.
31
- # Checks for improperly declared sprockets dependencies.
32
- # Raises helpful error messages.
33
- config.assets.raise_runtime_errors = true
34
-
35
- # Raises error for missing translations
36
- # config.action_view.raise_on_missing_translations = true
37
- end
@@ -1,80 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # Code is not reloaded between requests.
5
- config.cache_classes = true
6
-
7
- # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both threaded web servers
9
- # and those relying on copy on write to perform better.
10
- # Rake tasks automatically ignore this option for performance.
11
- config.eager_load = true
12
-
13
- # Full error reports are disabled and caching is turned on.
14
- config.consider_all_requests_local = false
15
- config.action_controller.perform_caching = true
16
-
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
- # config.action_dispatch.rack_cache = true
21
-
22
- # Compress JavaScripts and CSS.
23
- config.assets.js_compressor = :uglifier
24
- # config.assets.css_compressor = :sass
25
-
26
- # Do not fallback to assets pipeline if a precompiled asset is missed.
27
- config.assets.compile = false
28
-
29
- # Generate digests for assets URLs.
30
- config.assets.digest = true
31
-
32
- # Version of your assets, change this if you want to expire all your assets.
33
- config.assets.version = '1.0'
34
-
35
- # Specifies the header that your server uses for sending files.
36
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
37
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
38
-
39
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
40
- # config.force_ssl = true
41
-
42
- # Set to :debug to see everything in the log.
43
- config.log_level = :info
44
-
45
- # Prepend all log lines with the following tags.
46
- # config.log_tags = [ :subdomain, :uuid ]
47
-
48
- # Use a different logger for distributed setups.
49
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
50
-
51
- # Use a different cache store in production.
52
- # config.cache_store = :mem_cache_store
53
-
54
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
55
- # config.action_controller.asset_host = "http://assets.example.com"
56
-
57
- # Precompile additional assets.
58
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
59
- # config.assets.precompile += %w( search.js )
60
-
61
- # Ignore bad email addresses and do not raise email delivery errors.
62
- # Set this to true and configure the email server for immediate delivery to raise delivery errors.
63
- # config.action_mailer.raise_delivery_errors = false
64
-
65
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
66
- # the I18n.default_locale when a translation cannot be found).
67
- config.i18n.fallbacks = true
68
-
69
- # Send deprecation notices to registered listeners.
70
- config.active_support.deprecation = :notify
71
-
72
- # Disable automatic flushing of the log to improve performance.
73
- # config.autoflush_log = false
74
-
75
- # Use default logging formatter so that PID and timestamp are not suppressed.
76
- config.log_formatter = ::Logger::Formatter.new
77
-
78
- # Do not dump schema after migrations.
79
- config.active_record.dump_schema_after_migration = false
80
- end
@@ -1,36 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
-
15
- # Show full error reports and disable caching.
16
- config.consider_all_requests_local = true
17
- config.action_controller.perform_caching = false
18
-
19
- # Raise exceptions instead of rendering exception templates.
20
- config.action_dispatch.show_exceptions = false
21
-
22
- # Disable request forgery protection in test environment.
23
- config.action_controller.allow_forgery_protection = false
24
-
25
- # Tell Action Mailer not to deliver emails to the real world.
26
- # The :test delivery method accumulates sent emails in the
27
- # ActionMailer::Base.deliveries array.
28
- config.action_mailer.delivery_method = :test
29
-
30
- # Print deprecation notices to the stderr.
31
- config.active_support.deprecation = :stderr
32
-
33
- # Raises error for missing translations
34
- # config.action_view.raise_on_missing_translations = true
35
- config.action_mailer.default_url_options = { :host => 'localhost:3000' }
36
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,254 +0,0 @@
1
- require 'devise'
2
- # Use this hook to configure devise mailer, warden hooks and so forth.
3
- # Many of these configuration options can be set straight in your model.
4
- Devise.setup do |config|
5
- # The secret key used by Devise. Devise uses this key to generate
6
- # random tokens. Changing this key will render invalid all existing
7
- # confirmation, reset password and unlock tokens in the database.
8
- config.secret_key = 'e2daa993b70d0a5b780a7689f307784d47871a76f1ffbbbefb3f32a141b56ddc36bc6fe82c475d33aaac2dda91a07732b490328442f2c7a149bbd5a1511efc30'
9
-
10
- # ==> Mailer Configuration
11
- # Configure the e-mail address which will be shown in Devise::Mailer,
12
- # note that it will be overwritten if you use your own mailer class
13
- # with default "from" parameter.
14
- config.mailer_sender = 'noreply@student-energy.com'
15
-
16
- # Configure the class responsible to send e-mails.
17
- # config.mailer = 'Devise::Mailer'
18
-
19
- # ==> ORM configuration
20
- # Load and configure the ORM. Supports :active_record (default) and
21
- # :mongoid (bson_ext recommended) by default. Other ORMs may be
22
- # available as additional gems.
23
- require 'devise/orm/active_record'
24
-
25
- # ==> Configuration for any authentication mechanism
26
- # Configure which keys are used when authenticating a user. The default is
27
- # just :email. You can configure it to use [:username, :subdomain], so for
28
- # authenticating a user, both parameters are required. Remember that those
29
- # parameters are used only when authenticating and not when retrieving from
30
- # session. If you need permissions, you should implement that in a before filter.
31
- # You can also supply a hash where the value is a boolean determining whether
32
- # or not authentication should be aborted when the value is not present.
33
- # config.authentication_keys = [ :email ]
34
-
35
- # Configure parameters from the request object used for authentication. Each entry
36
- # given should be a request method and it will automatically be passed to the
37
- # find_for_authentication method and considered in your model lookup. For instance,
38
- # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
39
- # The same considerations mentioned for authentication_keys also apply to request_keys.
40
- # config.request_keys = []
41
-
42
- # Configure which authentication keys should be case-insensitive.
43
- # These keys will be downcased upon creating or modifying a user and when used
44
- # to authenticate or find a user. Default is :email.
45
- config.case_insensitive_keys = [ :email ]
46
-
47
- # Configure which authentication keys should have whitespace stripped.
48
- # These keys will have whitespace before and after removed upon creating or
49
- # modifying a user and when used to authenticate or find a user. Default is :email.
50
- config.strip_whitespace_keys = [ :email ]
51
-
52
- # Tell if authentication through request.params is enabled. True by default.
53
- # It can be set to an array that will enable params authentication only for the
54
- # given strategies, for example, `config.params_authenticatable = [:database]` will
55
- # enable it only for database (email + password) authentication.
56
- # config.params_authenticatable = true
57
-
58
- # Tell if authentication through HTTP Auth is enabled. False by default.
59
- # It can be set to an array that will enable http authentication only for the
60
- # given strategies, for example, `config.http_authenticatable = [:database]` will
61
- # enable it only for database authentication. The supported strategies are:
62
- # :database = Support basic authentication with authentication key + password
63
- # config.http_authenticatable = false
64
-
65
- # If http headers should be returned for AJAX requests. True by default.
66
- # config.http_authenticatable_on_xhr = true
67
-
68
- # The realm used in Http Basic Authentication. 'Application' by default.
69
- # config.http_authentication_realm = 'Application'
70
-
71
- # It will change confirmation, password recovery and other workflows
72
- # to behave the same regardless if the e-mail provided was right or wrong.
73
- # Does not affect registerable.
74
- # config.paranoid = true
75
-
76
- # By default Devise will store the user in session. You can skip storage for
77
- # particular strategies by setting this option.
78
- # Notice that if you are skipping storage for all authentication paths, you
79
- # may want to disable generating routes to Devise's sessions controller by
80
- # passing :skip => :sessions to `devise_for` in your config/routes.rb
81
- config.skip_session_storage = [:http_auth]
82
-
83
- # By default, Devise cleans up the CSRF token on authentication to
84
- # avoid CSRF token fixation attacks. This means that, when using AJAX
85
- # requests for sign in and sign up, you need to get a new CSRF token
86
- # from the server. You can disable this option at your own risk.
87
- # config.clean_up_csrf_token_on_authentication = true
88
-
89
- # ==> Configuration for :database_authenticatable
90
- # For bcrypt, this is the cost for hashing the password and defaults to 10. If
91
- # using other encryptors, it sets how many times you want the password re-encrypted.
92
- #
93
- # Limiting the stretches to just one in testing will increase the performance of
94
- # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
95
- # a value less than 10 in other environments.
96
- config.stretches = Rails.env.test? ? 1 : 10
97
-
98
- # Setup a pepper to generate the encrypted password.
99
- # config.pepper = '3e7aca2abd16f8786a4ffd678b7f9cb659b0835c5934f053324f35a83739e7eb09a7eca6ea2c65f7393680c1c467e077daa9d1a0dd66cdc83596bf43fd8eee26'
100
-
101
- # ==> Configuration for :confirmable
102
- # A period that the user is allowed to access the website even without
103
- # confirming his account. For instance, if set to 2.days, the user will be
104
- # able to access the website for two days without confirming his account,
105
- # access will be blocked just in the third day. Default is 0.days, meaning
106
- # the user cannot access the website without confirming his account.
107
- # config.allow_unconfirmed_access_for = 2.days
108
-
109
- # A period that the user is allowed to confirm their account before their
110
- # token becomes invalid. For example, if set to 3.days, the user can confirm
111
- # their account within 3 days after the mail was sent, but on the fourth day
112
- # their account can't be confirmed with the token any more.
113
- # Default is nil, meaning there is no restriction on how long a user can take
114
- # before confirming their account.
115
- # config.confirm_within = 3.days
116
-
117
- # If true, requires any email changes to be confirmed (exactly the same way as
118
- # initial account confirmation) to be applied. Requires additional unconfirmed_email
119
- # db field (see migrations). Until confirmed new email is stored in
120
- # unconfirmed email column, and copied to email column on successful confirmation.
121
- config.reconfirmable = true
122
-
123
- # Defines which key will be used when confirming an account
124
- # config.confirmation_keys = [ :email ]
125
-
126
- # ==> Configuration for :rememberable
127
- # The time the user will be remembered without asking for credentials again.
128
- # config.remember_for = 2.weeks
129
-
130
- # If true, extends the user's remember period when remembered via cookie.
131
- # config.extend_remember_period = false
132
-
133
- # Options to be passed to the created cookie. For instance, you can set
134
- # :secure => true in order to force SSL only cookies.
135
- # config.rememberable_options = {}
136
-
137
- # ==> Configuration for :validatable
138
- # Range for password length. Default is 8..128.
139
- config.password_length = 8..128
140
-
141
- # Email regex used to validate email formats. It simply asserts that
142
- # one (and only one) @ exists in the given string. This is mainly
143
- # to give user feedback and not to assert the e-mail validity.
144
- # config.email_regexp = /\A[^@]+@[^@]+\z/
145
-
146
- # ==> Configuration for :timeoutable
147
- # The time you want to timeout the user session without activity. After this
148
- # time the user will be asked for credentials again. Default is 30 minutes.
149
- # config.timeout_in = 30.minutes
150
-
151
- # If true, expires auth token on session timeout.
152
- # config.expire_auth_token_on_timeout = false
153
-
154
- # ==> Configuration for :lockable
155
- # Defines which strategy will be used to lock an account.
156
- # :failed_attempts = Locks an account after a number of failed attempts to sign in.
157
- # :none = No lock strategy. You should handle locking by yourself.
158
- # config.lock_strategy = :failed_attempts
159
-
160
- # Defines which key will be used when locking and unlocking an account
161
- # config.unlock_keys = [ :email ]
162
-
163
- # Defines which strategy will be used to unlock an account.
164
- # :email = Sends an unlock link to the user email
165
- # :time = Re-enables login after a certain amount of time (see :unlock_in below)
166
- # :both = Enables both strategies
167
- # :none = No unlock strategy. You should handle unlocking by yourself.
168
- # config.unlock_strategy = :both
169
-
170
- # Number of authentication tries before locking an account if lock_strategy
171
- # is failed attempts.
172
- # config.maximum_attempts = 20
173
-
174
- # Time interval to unlock the account if :time is enabled as unlock_strategy.
175
- # config.unlock_in = 1.hour
176
-
177
- # Warn on the last attempt before the account is locked.
178
- # config.last_attempt_warning = false
179
-
180
- # ==> Configuration for :recoverable
181
- #
182
- # Defines which key will be used when recovering the password for an account
183
- # config.reset_password_keys = [ :email ]
184
-
185
- # Time interval you can reset your password with a reset password key.
186
- # Don't put a too small interval or your users won't have the time to
187
- # change their passwords.
188
- config.reset_password_within = 6.hours
189
-
190
- # ==> Configuration for :encryptable
191
- # Allow you to use another encryption algorithm besides bcrypt (default). You can use
192
- # :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
193
- # :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
194
- # and :restful_authentication_sha1 (then you should set stretches to 10, and copy
195
- # REST_AUTH_SITE_KEY to pepper).
196
- #
197
- # Require the `devise-encryptable` gem when using anything other than bcrypt
198
- # config.encryptor = :sha512
199
-
200
- # ==> Scopes configuration
201
- # Turn scoped views on. Before rendering "sessions/new", it will first check for
202
- # "users/sessions/new". It's turned off by default because it's slower if you
203
- # are using only default views.
204
- # config.scoped_views = false
205
-
206
- # Configure the default scope given to Warden. By default it's the first
207
- # devise role declared in your routes (usually :user).
208
- # config.default_scope = :user
209
-
210
- # Set this configuration to false if you want /users/sign_out to sign out
211
- # only the current scope. By default, Devise signs out all scopes.
212
- # config.sign_out_all_scopes = true
213
-
214
- # ==> Navigation configuration
215
- # Lists the formats that should be treated as navigational. Formats like
216
- # :html, should redirect to the sign in page when the user does not have
217
- # access, but formats like :xml or :json, should return 401.
218
- #
219
- # If you have any extra navigational formats, like :iphone or :mobile, you
220
- # should add them to the navigational formats lists.
221
- #
222
- # The "*/*" below is required to match Internet Explorer requests.
223
- # config.navigational_formats = ['*/*', :html]
224
-
225
- # The default HTTP method used to sign out a resource. Default is :delete.
226
- config.sign_out_via = :delete
227
-
228
- # ==> OmniAuth
229
- # Add a new OmniAuth provider. Check the wiki for more information on setting
230
- # up on your models and hooks.
231
-
232
- # ==> Warden configuration
233
- # If you want to use other strategies, that are not supported by Devise, or
234
- # change the failure app, you can configure them inside the config.warden block.
235
- #
236
- # config.warden do |manager|
237
- # manager.intercept_401 = false
238
- # manager.default_strategies(:scope => :user).unshift :some_external_strategy
239
- # end
240
-
241
- # ==> Mountable engine configurations
242
- # When using Devise inside an engine, let's call it `MyEngine`, and this engine
243
- # is mountable, there are some extra configurations to be taken into account.
244
- # The following options are available, assuming the engine is mounted as:
245
- #
246
- # mount MyEngine, at: '/my_engine'
247
- #
248
- # The router that invoked `devise_for`, in the example above, would be:
249
- # config.router_name = :my_engine
250
- #
251
- # When using omniauth, Devise cannot automatically set Omniauth path,
252
- # so you need to do it manually. For the users scope, it would be:
253
- # config.omniauth_path_prefix = '/my_engine/users/auth'
254
- end