mno-enterprise-core 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -0
  3. data/Rakefile +12 -0
  4. data/app/assets/images/mno_enterprise/main-logo.png +0 -0
  5. data/app/controllers/mno_enterprise/application_controller.rb +116 -0
  6. data/app/helpers/mno_enterprise/application_helper.rb +67 -0
  7. data/app/helpers/mno_enterprise/impersonate_helper.rb +27 -0
  8. data/app/models/mno_enterprise/ability.rb +6 -0
  9. data/app/models/mno_enterprise/app.rb +72 -0
  10. data/app/models/mno_enterprise/app_instance.rb +36 -0
  11. data/app/models/mno_enterprise/app_instances_sync.rb +6 -0
  12. data/app/models/mno_enterprise/arrears_situation.rb +6 -0
  13. data/app/models/mno_enterprise/audit_event.rb +21 -0
  14. data/app/models/mno_enterprise/base_resource.rb +228 -0
  15. data/app/models/mno_enterprise/credit_card.rb +40 -0
  16. data/app/models/mno_enterprise/deletion_request.rb +35 -0
  17. data/app/models/mno_enterprise/impac/dashboard.rb +36 -0
  18. data/app/models/mno_enterprise/impac/dashboard_provisioner.rb +5 -0
  19. data/app/models/mno_enterprise/impac/kpi.rb +9 -0
  20. data/app/models/mno_enterprise/impac/widget.rb +13 -0
  21. data/app/models/mno_enterprise/invoice.rb +53 -0
  22. data/app/models/mno_enterprise/org_invite.rb +50 -0
  23. data/app/models/mno_enterprise/organization.rb +33 -0
  24. data/app/models/mno_enterprise/team.rb +50 -0
  25. data/app/models/mno_enterprise/tenant.rb +5 -0
  26. data/app/models/mno_enterprise/tenant_invoice.rb +5 -0
  27. data/app/models/mno_enterprise/user.rb +183 -0
  28. data/app/pdf/mno_enterprise/invoice_pdf.rb +516 -0
  29. data/config/initializers/audit_log.rb +5 -0
  30. data/config/locales/devise.en.yml +60 -0
  31. data/config/routes.rb +2 -0
  32. data/config/styleguide.yml +106 -0
  33. data/lib/accountingjs_serializer.rb +51 -0
  34. data/lib/devise/controllers/extension_helpers.rb +52 -0
  35. data/lib/devise/extension_routes.rb +11 -0
  36. data/lib/devise/hooks/password_expirable.rb +5 -0
  37. data/lib/devise/models/password_expirable.rb +28 -0
  38. data/lib/devise/models/remote_authenticatable.rb +48 -0
  39. data/lib/devise/strategies/remote_authenticatable.rb +44 -0
  40. data/lib/devise_extension.rb +36 -0
  41. data/lib/faraday/adapter/net_http_no_proxy.rb +19 -0
  42. data/lib/generators/mno_enterprise/database_extension/USAGE +11 -0
  43. data/lib/generators/mno_enterprise/database_extension/database_extension_generator.rb +36 -0
  44. data/lib/generators/mno_enterprise/database_extension/templates/model.rb +9 -0
  45. data/lib/generators/mno_enterprise/dummy/dummy_generator.rb +98 -0
  46. data/lib/generators/mno_enterprise/dummy/templates/rails/application.rb.erb +9 -0
  47. data/lib/generators/mno_enterprise/dummy/templates/rails/boot.rb.erb +6 -0
  48. data/lib/generators/mno_enterprise/dummy/templates/rails/database.yml +22 -0
  49. data/lib/generators/mno_enterprise/dummy/templates/rails/routes.rb +8 -0
  50. data/lib/generators/mno_enterprise/dummy/templates/rails/test-env.rb +45 -0
  51. data/lib/generators/mno_enterprise/install/install_generator.rb +140 -0
  52. data/lib/generators/mno_enterprise/install/templates/Procfile +1 -0
  53. data/lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb +135 -0
  54. data/lib/generators/mno_enterprise/install/templates/config/mno_enterprise_styleguide.yml +104 -0
  55. data/lib/generators/mno_enterprise/install/templates/javascripts/mno_enterprise_extensions.js +7 -0
  56. data/lib/generators/mno_enterprise/install/templates/stylesheets/main.less_erb +25 -0
  57. data/lib/generators/mno_enterprise/install/templates/stylesheets/theme.less_erb +59 -0
  58. data/lib/generators/mno_enterprise/install/templates/stylesheets/variables.less +337 -0
  59. data/lib/generators/mno_enterprise/install/templates/tasks/sprites.rake +14 -0
  60. data/lib/generators/mno_enterprise/puma_stack/puma_stack_generator.rb +58 -0
  61. data/lib/generators/mno_enterprise/templates/scripts/monit/app-server.conf +8 -0
  62. data/lib/generators/mno_enterprise/templates/scripts/nginx/app +51 -0
  63. data/lib/generators/mno_enterprise/templates/scripts/puma.rb +25 -0
  64. data/lib/generators/mno_enterprise/templates/scripts/setup.sh +27 -0
  65. data/lib/generators/mno_enterprise/templates/scripts/upstart/app-web-hotrestart.conf +26 -0
  66. data/lib/generators/mno_enterprise/templates/scripts/upstart/app-web-server.conf +34 -0
  67. data/lib/generators/mno_enterprise/templates/scripts/upstart/app-web.conf +2 -0
  68. data/lib/generators/mno_enterprise/templates/scripts/upstart/app.conf +11 -0
  69. data/lib/her_extension/her_orm_adapter.rb +54 -0
  70. data/lib/her_extension/middleware/mnoe_api_v1_parse_json.rb +54 -0
  71. data/lib/her_extension/model/associations/association.rb +61 -0
  72. data/lib/her_extension/model/associations/association_proxy.rb +34 -0
  73. data/lib/her_extension/model/associations/has_many_association.rb +115 -0
  74. data/lib/her_extension/model/attributes.rb +43 -0
  75. data/lib/her_extension/model/orm.rb +59 -0
  76. data/lib/her_extension/model/parse.rb +40 -0
  77. data/lib/her_extension/model/relation.rb +92 -0
  78. data/lib/her_extension/validations/remote_uniqueness_validation.rb +33 -0
  79. data/lib/html_processor.rb +106 -0
  80. data/lib/mandrill_client.rb +58 -0
  81. data/lib/mno-enterprise-core.rb +1 -0
  82. data/lib/mno_enterprise/concerns.rb +4 -0
  83. data/lib/mno_enterprise/concerns/controllers.rb +6 -0
  84. data/lib/mno_enterprise/concerns/controllers/angular_csrf.rb +59 -0
  85. data/lib/mno_enterprise/concerns/controllers/auth.rb +9 -0
  86. data/lib/mno_enterprise/concerns/controllers/auth/confirmations_controller.rb +187 -0
  87. data/lib/mno_enterprise/concerns/controllers/auth/passwords_controller.rb +54 -0
  88. data/lib/mno_enterprise/concerns/controllers/auth/registrations_controller.rb +136 -0
  89. data/lib/mno_enterprise/concerns/controllers/auth/sessions_controller.rb +54 -0
  90. data/lib/mno_enterprise/concerns/controllers/auth/unlocks_controller.rb +50 -0
  91. data/lib/mno_enterprise/concerns/models.rb +6 -0
  92. data/lib/mno_enterprise/concerns/models/ability.rb +108 -0
  93. data/lib/mno_enterprise/concerns/models/app_instance.rb +100 -0
  94. data/lib/mno_enterprise/concerns/models/organization.rb +102 -0
  95. data/lib/mno_enterprise/core.rb +279 -0
  96. data/lib/mno_enterprise/database_extendable.rb +57 -0
  97. data/lib/mno_enterprise/engine.rb +33 -0
  98. data/lib/mno_enterprise/testing_support/ability_test_helper.rb +10 -0
  99. data/lib/mno_enterprise/testing_support/common_rake.rb +19 -0
  100. data/lib/mno_enterprise/testing_support/factories.rb +13 -0
  101. data/lib/mno_enterprise/testing_support/factories/app_instances.rb +30 -0
  102. data/lib/mno_enterprise/testing_support/factories/apps.rb +45 -0
  103. data/lib/mno_enterprise/testing_support/factories/arrears_situation.rb +14 -0
  104. data/lib/mno_enterprise/testing_support/factories/audit_event.rb +15 -0
  105. data/lib/mno_enterprise/testing_support/factories/credit_card.rb +33 -0
  106. data/lib/mno_enterprise/testing_support/factories/deletion_request.rb +17 -0
  107. data/lib/mno_enterprise/testing_support/factories/impac/dashboards.rb +15 -0
  108. data/lib/mno_enterprise/testing_support/factories/impac/kpis.rb +20 -0
  109. data/lib/mno_enterprise/testing_support/factories/impac/widgets.rb +15 -0
  110. data/lib/mno_enterprise/testing_support/factories/invoices.rb +51 -0
  111. data/lib/mno_enterprise/testing_support/factories/org_invite.rb +24 -0
  112. data/lib/mno_enterprise/testing_support/factories/organizations.rb +25 -0
  113. data/lib/mno_enterprise/testing_support/factories/team.rb +17 -0
  114. data/lib/mno_enterprise/testing_support/factories/tenant.rb +12 -0
  115. data/lib/mno_enterprise/testing_support/factories/tenant_invoice.rb +29 -0
  116. data/lib/mno_enterprise/testing_support/factories/users.rb +48 -0
  117. data/lib/mno_enterprise/testing_support/jpi_v1_test_helper.rb +49 -0
  118. data/lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb +167 -0
  119. data/lib/mno_enterprise/testing_support/mnoe_faraday_test_adapter.rb +173 -0
  120. data/lib/mno_enterprise/testing_support/organizations_shared_helpers.rb +175 -0
  121. data/lib/mno_enterprise/testing_support/user_action_shared.rb +47 -0
  122. data/lib/mno_enterprise/version.rb +3 -0
  123. data/lib/tasks/mno_enterprise_tasks.rake +22 -0
  124. data/spec/controllers/mno_enterprise/angular_csrf_spec.rb +42 -0
  125. data/spec/lib/her_extension/her_orm_adapter.rb +7 -0
  126. data/spec/lib/her_extension/model/relation_spec.rb +7 -0
  127. data/spec/lib/mandrill_client_spec.rb +64 -0
  128. data/spec/mno_enterprise_spec.rb +79 -0
  129. data/spec/models/mno_enterprise/app_instance_spec.rb +7 -0
  130. data/spec/models/mno_enterprise/app_spec.rb +62 -0
  131. data/spec/models/mno_enterprise/base_resource_spec.rb +28 -0
  132. data/spec/models/mno_enterprise/deletion_request_spec.rb +26 -0
  133. data/spec/models/mno_enterprise/invoice_spec.rb +7 -0
  134. data/spec/models/mno_enterprise/organization_spec.rb +7 -0
  135. data/spec/models/mno_enterprise/user_spec.rb +44 -0
  136. data/spec/rails_helper.rb +73 -0
  137. data/spec/spec_helper.rb +78 -0
  138. metadata +421 -0
@@ -0,0 +1,7 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe AppInstance, type: :model do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
@@ -0,0 +1,62 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe App, :type => :model do
5
+ describe '.categories' do
6
+ let(:categories) { %w(Other CATEGORY category) }
7
+ let(:app) { build(:app, categories: categories) }
8
+ let(:list) { nil }
9
+ subject { described_class.categories(list) }
10
+
11
+ context 'when no list' do
12
+ before { allow(described_class).to receive(:all).and_return([app]) }
13
+
14
+ it 'returns a unique (case insensitive) sorted list' do
15
+ expect(subject).to eq(%W(CATEGORY Other))
16
+ end
17
+ end
18
+
19
+ context 'with a list' do
20
+ let(:app2) { build(:app, categories: ['Other Category', 'One']) }
21
+ let(:list) { [app2] }
22
+ it 'scopes the categories to the list of app' do
23
+ expect(subject).to eq(['One', 'Other Category'])
24
+ end
25
+ end
26
+ end
27
+
28
+ describe 'appinfo methods' do
29
+ %i(single_billing? coming_soon?).each do |method|
30
+ it { expect(described_class.new).to respond_to(method) }
31
+ end
32
+ end
33
+
34
+ describe '#sanitized_description' do
35
+ let(:app) { build(:app, description: "Some description by Maestrano") }
36
+ it 'replaces any mention of maestrano by the name of the platform' do
37
+ expect(app.sanitized_description).to eq("Some description by #{MnoEnterprise.app_name}")
38
+ end
39
+ end
40
+
41
+ describe '#regenerate_api_key!' do
42
+ let(:app) { build(:app) }
43
+ let(:response) { build(:app, api_key: 'secret-key') }
44
+
45
+ before { api_stub_for(put: "/apps/#{app.id}", response: from_api(response)) }
46
+
47
+ subject { app.regenerate_api_key! }
48
+
49
+ it 'regenerate the api key' do
50
+ expect(app).to receive(:put).with(operation: 'regenerate_api_key').and_call_original
51
+ subject
52
+ end
53
+
54
+ it 'refreshes the #api_key field' do
55
+ old = app.api_key
56
+ subject
57
+ expect(app.api_key).to_not eq(old)
58
+ expect(app.api_key).to eq(response.api_key)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,28 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe BaseResource, type: :model do
5
+ describe '#cache_key' do
6
+ context 'for existing record' do
7
+ let(:user) { build(:user) }
8
+
9
+ it 'uses updated_at' do
10
+ expect(user.cache_key).to eq("mno_enterprise/users/#{user.id}-#{user.updated_at.utc.to_s(:nsec)}")
11
+ end
12
+
13
+ context 'when updated_at is nil' do
14
+ before { user.updated_at = nil }
15
+ it { expect(user.cache_key).to eq("mno_enterprise/users/#{user.id}") }
16
+ end
17
+
18
+ it 'uses the named timestamp' do
19
+ expect(user.cache_key(:confirmed_at)).to eq("mno_enterprise/users/#{user.id}-#{user.confirmed_at.utc.to_s(:nsec)}")
20
+ end
21
+ end
22
+
23
+ context 'for new record' do
24
+ it { expect(User.new.cache_key).to eq('mno_enterprise/users/new') }
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,26 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: deletion_requests
4
+ #
5
+ # id :integer not null, primary key
6
+ # token :string(255)
7
+ # status :string(255)
8
+ # created_at :datetime not null
9
+ # updated_at :datetime not null
10
+ #
11
+ require 'rails_helper'
12
+
13
+ module MnoEnterprise
14
+ RSpec.describe DeletionRequest, type: :model do
15
+ describe 'Instance methods' do
16
+ let(:deletion_request) { build(:deletion_request, token: '1sd5f323S1D5AS') }
17
+ describe '#to_param' do
18
+ it "returns the deletion_request token" do
19
+ expect(deletion_request.to_param).to eq(deletion_request.token)
20
+ end
21
+ end
22
+ end
23
+
24
+
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe Invoice, :type => :model do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe Organization, :type => :model do
5
+ pending "add some examples to (or delete) #{__FILE__}"
6
+ end
7
+ end
@@ -0,0 +1,44 @@
1
+ require 'rails_helper'
2
+
3
+ module MnoEnterprise
4
+ RSpec.describe User, type: :model do
5
+ describe 'password strength' do
6
+ let(:user) do
7
+ # Initialize this way so the class reload is taken into account (the factory doesnt reload the User class)
8
+ MnoEnterprise::User.new(attributes_for(:user, password: 'password')).tap {|u| u.clear_attribute_changes!}
9
+ end
10
+
11
+ context 'without password regex' do
12
+ it 'does not validate the password strength' do
13
+ expect(user).to be_valid
14
+ end
15
+ end
16
+
17
+ context 'with password regex' do
18
+ before do
19
+ Devise.password_regex = /(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/
20
+
21
+ # Reload User class to redefine the validation
22
+ # Removes MnoEnterprise::User from object-space:
23
+ MnoEnterprise.send(:remove_const, :User)
24
+ # Reloads the module (require might also work):
25
+ load 'app/models/mno_enterprise/user.rb'
26
+ end
27
+
28
+ it 'validates the password strength' do
29
+ expect(user).to be_invalid
30
+ expect(user.errors[:password].first).to eq('must contains at least one uppercase letter, one lower case letter and a number')
31
+ end
32
+
33
+ after do
34
+ # Reset to default
35
+ Devise.password_regex = nil
36
+ MnoEnterprise.send(:remove_const, :User)
37
+ load 'app/models/mno_enterprise/user.rb'
38
+ end
39
+ end
40
+
41
+ end
42
+
43
+ end
44
+ end
@@ -0,0 +1,73 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require 'spec_helper'
4
+ require 'her'
5
+ require 'factory_girl_rails'
6
+
7
+ # Load the Dummy application
8
+ require File.expand_path("../../spec/dummy/config/environment.rb", __FILE__)
9
+ require 'rspec/rails'
10
+
11
+ # Check Dummy application migrations
12
+ ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
13
+ ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
14
+
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc, in
17
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
18
+ # run as spec files by default. This means that files in spec/support that end
19
+ # in _spec.rb will both be required and run as specs, causing the specs to be
20
+ # run twice. It is recommended that you do not name files matching this glob to
21
+ # end with _spec.rb. You can configure this pattern with the --pattern
22
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
23
+ Dir[Rails.root.join("../..","spec/support/**/*.rb")].each { |f| require f }
24
+
25
+ # Require all factories
26
+ require 'mno_enterprise/testing_support/factories'
27
+
28
+ # Checks for pending migrations before tests are run.
29
+ # If you are not using ActiveRecord, you can remove this line.
30
+ ActiveRecord::Migration.maintain_test_schema!
31
+
32
+ RSpec.configure do |config|
33
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
34
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
35
+
36
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
37
+ # examples within a transaction, remove the following line or assign false
38
+ # instead of true.
39
+ # config.use_transactional_fixtures = true
40
+
41
+ # Include FactoryGirl methods to avoid typing FactoryGirl.create(...)
42
+ config.include FactoryGirl::Syntax::Methods
43
+
44
+ # Include MnoEnterpriseApiTestHelper
45
+ # Enable API stub helpers (e.g.: api_stub_for)
46
+ config.include MnoEnterpriseApiTestHelper
47
+
48
+ # Include ability test helper
49
+ config.include AbilityTestHelper, type: :controller
50
+
51
+ # Include devise tests
52
+ config.include Devise::TestHelpers, type: :controller
53
+
54
+ # Reset API stubs before each step
55
+ config.before :each do
56
+ api_stub_reset
57
+ end
58
+
59
+ # RSpec Rails can automatically mix in different behaviours to your tests
60
+ # based on their file location, for example enabling you to call `get` and
61
+ # `post` in specs under `spec/controllers`.
62
+ #
63
+ # You can disable this behaviour by removing the line below, and instead
64
+ # explicitly tag your specs with their type, e.g.:
65
+ #
66
+ # RSpec.describe UsersController, :type => :controller do
67
+ # # ...
68
+ # end
69
+ #
70
+ # The different available types are documented in the features, such as in
71
+ # https://relishapp.com/rspec/rspec-rails/docs
72
+ config.infer_spec_type_from_file_location!
73
+ end
@@ -0,0 +1,78 @@
1
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
+ # file to always be loaded, without a need to explicitly require it in any files.
5
+ #
6
+ # Given that it is always loaded, you are encouraged to keep this file as
7
+ # light-weight as possible. Requiring heavyweight dependencies from this file
8
+ # will add to the boot time of your test suite on EVERY test run, even for an
9
+ # individual file that may not need all of that loaded. Instead, make a
10
+ # separate helper file that requires this one and then use it only in the specs
11
+ # that actually need it.
12
+ #
13
+ # The `.rspec` file also contains a few flags that are not defaults but that
14
+ # users commonly want.
15
+ #
16
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
+ RSpec.configure do |config|
18
+ # The settings below are suggested to provide a good initial experience
19
+ # with RSpec, but feel free to customize to your heart's content.
20
+ =begin
21
+ # These two settings work together to allow you to limit a spec run
22
+ # to individual examples or groups you care about by tagging them with
23
+ # `:focus` metadata. When nothing is tagged with `:focus`, all examples
24
+ # get run.
25
+ config.filter_run :focus
26
+ config.run_all_when_everything_filtered = true
27
+
28
+ # Many RSpec users commonly either run the entire suite or an individual
29
+ # file, and it's useful to allow more verbose output when running an
30
+ # individual spec file.
31
+ if config.files_to_run.one?
32
+ # Use the documentation formatter for detailed output,
33
+ # unless a formatter has already been configured
34
+ # (e.g. via a command-line flag).
35
+ config.default_formatter = 'doc'
36
+ end
37
+
38
+ # Print the 10 slowest examples and example groups at the
39
+ # end of the spec run, to help surface which specs are running
40
+ # particularly slow.
41
+ config.profile_examples = 10
42
+
43
+ # Run specs in random order to surface order dependencies. If you find an
44
+ # order dependency and want to debug it, you can fix the order by providing
45
+ # the seed, which is printed after each run.
46
+ # --seed 1234
47
+ config.order = :random
48
+
49
+ # Seed global randomization in this process using the `--seed` CLI option.
50
+ # Setting this allows you to use `--seed` to deterministically reproduce
51
+ # test failures related to randomization by passing the same `--seed` value
52
+ # as the one that triggered the failure.
53
+ Kernel.srand config.seed
54
+
55
+ # rspec-expectations config goes here. You can use an alternate
56
+ # assertion/expectation library such as wrong or the stdlib/minitest
57
+ # assertions if you prefer.
58
+ config.expect_with :rspec do |expectations|
59
+ # Enable only the newer, non-monkey-patching expect syntax.
60
+ # For more details, see:
61
+ # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62
+ expectations.syntax = :expect
63
+ end
64
+
65
+ # rspec-mocks config goes here. You can use an alternate test double
66
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
67
+ config.mock_with :rspec do |mocks|
68
+ # Enable only the newer, non-monkey-patching expect syntax.
69
+ # For more details, see:
70
+ # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71
+ mocks.syntax = :expect
72
+
73
+ # Prevents you from mocking or stubbing a method that does not exist on
74
+ # a real object. This is generally recommended.
75
+ mocks.verify_partial_doubles = true
76
+ end
77
+ =end
78
+ end
metadata ADDED
@@ -0,0 +1,421 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mno-enterprise-core
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Arnaud Lachaume
8
+ - Olivier Brisse
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-04-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '4.2'
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 4.2.0
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '4.2'
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.0
34
+ - !ruby/object:Gem::Dependency
35
+ name: her
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.7.3
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.3
48
+ - !ruby/object:Gem::Dependency
49
+ name: faraday_middleware
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.10.0
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.10.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: devise
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.0'
76
+ - !ruby/object:Gem::Dependency
77
+ name: cancancan
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.10'
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.10'
90
+ - !ruby/object:Gem::Dependency
91
+ name: countries
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.11.3
97
+ type: :runtime
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.11.3
104
+ - !ruby/object:Gem::Dependency
105
+ name: jwt
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.4'
111
+ type: :runtime
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.4'
118
+ - !ruby/object:Gem::Dependency
119
+ name: mandrill-api
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
125
+ - - ">="
126
+ - !ruby/object:Gem::Version
127
+ version: 1.0.53
128
+ type: :runtime
129
+ prerelease: false
130
+ version_requirements: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '1.0'
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: 1.0.53
138
+ - !ruby/object:Gem::Dependency
139
+ name: deepstruct
140
+ requirement: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.0.7
145
+ type: :runtime
146
+ prerelease: false
147
+ version_requirements: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: 0.0.7
152
+ - !ruby/object:Gem::Dependency
153
+ name: prawn
154
+ requirement: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '2.0'
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ version: 2.0.1
162
+ type: :runtime
163
+ prerelease: false
164
+ version_requirements: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - "~>"
167
+ - !ruby/object:Gem::Version
168
+ version: '2.0'
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: 2.0.1
172
+ - !ruby/object:Gem::Dependency
173
+ name: prawn-table
174
+ requirement: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - "~>"
177
+ - !ruby/object:Gem::Version
178
+ version: 0.2.1
179
+ type: :runtime
180
+ prerelease: false
181
+ version_requirements: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - "~>"
184
+ - !ruby/object:Gem::Version
185
+ version: 0.2.1
186
+ - !ruby/object:Gem::Dependency
187
+ name: money
188
+ requirement: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - "~>"
191
+ - !ruby/object:Gem::Version
192
+ version: '6.5'
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: 6.5.1
196
+ type: :runtime
197
+ prerelease: false
198
+ version_requirements: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: '6.5'
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: 6.5.1
206
+ - !ruby/object:Gem::Dependency
207
+ name: redcarpet
208
+ requirement: !ruby/object:Gem::Requirement
209
+ requirements:
210
+ - - "~>"
211
+ - !ruby/object:Gem::Version
212
+ version: '3.3'
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: 3.3.3
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '3.3'
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: 3.3.3
226
+ - !ruby/object:Gem::Dependency
227
+ name: sanitize
228
+ requirement: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - "~>"
231
+ - !ruby/object:Gem::Version
232
+ version: '4.0'
233
+ type: :runtime
234
+ prerelease: false
235
+ version_requirements: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - "~>"
238
+ - !ruby/object:Gem::Version
239
+ version: '4.0'
240
+ description: Core functionnality of MNOE. This handles the core functionnality.
241
+ email:
242
+ - developers@maestrano.com
243
+ executables: []
244
+ extensions: []
245
+ extra_rdoc_files: []
246
+ files:
247
+ - LICENSE
248
+ - Rakefile
249
+ - app/assets/images/mno_enterprise/main-logo.png
250
+ - app/controllers/mno_enterprise/application_controller.rb
251
+ - app/helpers/mno_enterprise/application_helper.rb
252
+ - app/helpers/mno_enterprise/impersonate_helper.rb
253
+ - app/models/mno_enterprise/ability.rb
254
+ - app/models/mno_enterprise/app.rb
255
+ - app/models/mno_enterprise/app_instance.rb
256
+ - app/models/mno_enterprise/app_instances_sync.rb
257
+ - app/models/mno_enterprise/arrears_situation.rb
258
+ - app/models/mno_enterprise/audit_event.rb
259
+ - app/models/mno_enterprise/base_resource.rb
260
+ - app/models/mno_enterprise/credit_card.rb
261
+ - app/models/mno_enterprise/deletion_request.rb
262
+ - app/models/mno_enterprise/impac/dashboard.rb
263
+ - app/models/mno_enterprise/impac/dashboard_provisioner.rb
264
+ - app/models/mno_enterprise/impac/kpi.rb
265
+ - app/models/mno_enterprise/impac/widget.rb
266
+ - app/models/mno_enterprise/invoice.rb
267
+ - app/models/mno_enterprise/org_invite.rb
268
+ - app/models/mno_enterprise/organization.rb
269
+ - app/models/mno_enterprise/team.rb
270
+ - app/models/mno_enterprise/tenant.rb
271
+ - app/models/mno_enterprise/tenant_invoice.rb
272
+ - app/models/mno_enterprise/user.rb
273
+ - app/pdf/mno_enterprise/invoice_pdf.rb
274
+ - config/initializers/audit_log.rb
275
+ - config/locales/devise.en.yml
276
+ - config/routes.rb
277
+ - config/styleguide.yml
278
+ - lib/accountingjs_serializer.rb
279
+ - lib/devise/controllers/extension_helpers.rb
280
+ - lib/devise/extension_routes.rb
281
+ - lib/devise/hooks/password_expirable.rb
282
+ - lib/devise/models/password_expirable.rb
283
+ - lib/devise/models/remote_authenticatable.rb
284
+ - lib/devise/strategies/remote_authenticatable.rb
285
+ - lib/devise_extension.rb
286
+ - lib/faraday/adapter/net_http_no_proxy.rb
287
+ - lib/generators/mno_enterprise/database_extension/USAGE
288
+ - lib/generators/mno_enterprise/database_extension/database_extension_generator.rb
289
+ - lib/generators/mno_enterprise/database_extension/templates/model.rb
290
+ - lib/generators/mno_enterprise/dummy/dummy_generator.rb
291
+ - lib/generators/mno_enterprise/dummy/templates/rails/application.rb.erb
292
+ - lib/generators/mno_enterprise/dummy/templates/rails/boot.rb.erb
293
+ - lib/generators/mno_enterprise/dummy/templates/rails/database.yml
294
+ - lib/generators/mno_enterprise/dummy/templates/rails/routes.rb
295
+ - lib/generators/mno_enterprise/dummy/templates/rails/test-env.rb
296
+ - lib/generators/mno_enterprise/install/install_generator.rb
297
+ - lib/generators/mno_enterprise/install/templates/Procfile
298
+ - lib/generators/mno_enterprise/install/templates/config/initializers/mno_enterprise.rb
299
+ - lib/generators/mno_enterprise/install/templates/config/mno_enterprise_styleguide.yml
300
+ - lib/generators/mno_enterprise/install/templates/javascripts/mno_enterprise_extensions.js
301
+ - lib/generators/mno_enterprise/install/templates/stylesheets/main.less_erb
302
+ - lib/generators/mno_enterprise/install/templates/stylesheets/theme.less_erb
303
+ - lib/generators/mno_enterprise/install/templates/stylesheets/variables.less
304
+ - lib/generators/mno_enterprise/install/templates/tasks/sprites.rake
305
+ - lib/generators/mno_enterprise/puma_stack/puma_stack_generator.rb
306
+ - lib/generators/mno_enterprise/templates/scripts/monit/app-server.conf
307
+ - lib/generators/mno_enterprise/templates/scripts/nginx/app
308
+ - lib/generators/mno_enterprise/templates/scripts/puma.rb
309
+ - lib/generators/mno_enterprise/templates/scripts/setup.sh
310
+ - lib/generators/mno_enterprise/templates/scripts/upstart/app-web-hotrestart.conf
311
+ - lib/generators/mno_enterprise/templates/scripts/upstart/app-web-server.conf
312
+ - lib/generators/mno_enterprise/templates/scripts/upstart/app-web.conf
313
+ - lib/generators/mno_enterprise/templates/scripts/upstart/app.conf
314
+ - lib/her_extension/her_orm_adapter.rb
315
+ - lib/her_extension/middleware/mnoe_api_v1_parse_json.rb
316
+ - lib/her_extension/model/associations/association.rb
317
+ - lib/her_extension/model/associations/association_proxy.rb
318
+ - lib/her_extension/model/associations/has_many_association.rb
319
+ - lib/her_extension/model/attributes.rb
320
+ - lib/her_extension/model/orm.rb
321
+ - lib/her_extension/model/parse.rb
322
+ - lib/her_extension/model/relation.rb
323
+ - lib/her_extension/validations/remote_uniqueness_validation.rb
324
+ - lib/html_processor.rb
325
+ - lib/mandrill_client.rb
326
+ - lib/mno-enterprise-core.rb
327
+ - lib/mno_enterprise/concerns.rb
328
+ - lib/mno_enterprise/concerns/controllers.rb
329
+ - lib/mno_enterprise/concerns/controllers/angular_csrf.rb
330
+ - lib/mno_enterprise/concerns/controllers/auth.rb
331
+ - lib/mno_enterprise/concerns/controllers/auth/confirmations_controller.rb
332
+ - lib/mno_enterprise/concerns/controllers/auth/passwords_controller.rb
333
+ - lib/mno_enterprise/concerns/controllers/auth/registrations_controller.rb
334
+ - lib/mno_enterprise/concerns/controllers/auth/sessions_controller.rb
335
+ - lib/mno_enterprise/concerns/controllers/auth/unlocks_controller.rb
336
+ - lib/mno_enterprise/concerns/models.rb
337
+ - lib/mno_enterprise/concerns/models/ability.rb
338
+ - lib/mno_enterprise/concerns/models/app_instance.rb
339
+ - lib/mno_enterprise/concerns/models/organization.rb
340
+ - lib/mno_enterprise/core.rb
341
+ - lib/mno_enterprise/database_extendable.rb
342
+ - lib/mno_enterprise/engine.rb
343
+ - lib/mno_enterprise/testing_support/ability_test_helper.rb
344
+ - lib/mno_enterprise/testing_support/common_rake.rb
345
+ - lib/mno_enterprise/testing_support/factories.rb
346
+ - lib/mno_enterprise/testing_support/factories/app_instances.rb
347
+ - lib/mno_enterprise/testing_support/factories/apps.rb
348
+ - lib/mno_enterprise/testing_support/factories/arrears_situation.rb
349
+ - lib/mno_enterprise/testing_support/factories/audit_event.rb
350
+ - lib/mno_enterprise/testing_support/factories/credit_card.rb
351
+ - lib/mno_enterprise/testing_support/factories/deletion_request.rb
352
+ - lib/mno_enterprise/testing_support/factories/impac/dashboards.rb
353
+ - lib/mno_enterprise/testing_support/factories/impac/kpis.rb
354
+ - lib/mno_enterprise/testing_support/factories/impac/widgets.rb
355
+ - lib/mno_enterprise/testing_support/factories/invoices.rb
356
+ - lib/mno_enterprise/testing_support/factories/org_invite.rb
357
+ - lib/mno_enterprise/testing_support/factories/organizations.rb
358
+ - lib/mno_enterprise/testing_support/factories/team.rb
359
+ - lib/mno_enterprise/testing_support/factories/tenant.rb
360
+ - lib/mno_enterprise/testing_support/factories/tenant_invoice.rb
361
+ - lib/mno_enterprise/testing_support/factories/users.rb
362
+ - lib/mno_enterprise/testing_support/jpi_v1_test_helper.rb
363
+ - lib/mno_enterprise/testing_support/mno_enterprise_api_test_helper.rb
364
+ - lib/mno_enterprise/testing_support/mnoe_faraday_test_adapter.rb
365
+ - lib/mno_enterprise/testing_support/organizations_shared_helpers.rb
366
+ - lib/mno_enterprise/testing_support/user_action_shared.rb
367
+ - lib/mno_enterprise/version.rb
368
+ - lib/tasks/mno_enterprise_tasks.rake
369
+ - spec/controllers/mno_enterprise/angular_csrf_spec.rb
370
+ - spec/lib/her_extension/her_orm_adapter.rb
371
+ - spec/lib/her_extension/model/relation_spec.rb
372
+ - spec/lib/mandrill_client_spec.rb
373
+ - spec/mno_enterprise_spec.rb
374
+ - spec/models/mno_enterprise/app_instance_spec.rb
375
+ - spec/models/mno_enterprise/app_spec.rb
376
+ - spec/models/mno_enterprise/base_resource_spec.rb
377
+ - spec/models/mno_enterprise/deletion_request_spec.rb
378
+ - spec/models/mno_enterprise/invoice_spec.rb
379
+ - spec/models/mno_enterprise/organization_spec.rb
380
+ - spec/models/mno_enterprise/user_spec.rb
381
+ - spec/rails_helper.rb
382
+ - spec/spec_helper.rb
383
+ homepage: https://maestrano.com
384
+ licenses:
385
+ - Maestrano Enterprise License V1
386
+ metadata: {}
387
+ post_install_message:
388
+ rdoc_options: []
389
+ require_paths:
390
+ - lib
391
+ required_ruby_version: !ruby/object:Gem::Requirement
392
+ requirements:
393
+ - - ">="
394
+ - !ruby/object:Gem::Version
395
+ version: '0'
396
+ required_rubygems_version: !ruby/object:Gem::Requirement
397
+ requirements:
398
+ - - ">="
399
+ - !ruby/object:Gem::Version
400
+ version: '0'
401
+ requirements: []
402
+ rubyforge_project:
403
+ rubygems_version: 2.2.2
404
+ signing_key:
405
+ specification_version: 4
406
+ summary: Maestrano Enterprise - Core functionnality
407
+ test_files:
408
+ - spec/controllers/mno_enterprise/angular_csrf_spec.rb
409
+ - spec/lib/her_extension/her_orm_adapter.rb
410
+ - spec/lib/her_extension/model/relation_spec.rb
411
+ - spec/lib/mandrill_client_spec.rb
412
+ - spec/mno_enterprise_spec.rb
413
+ - spec/models/mno_enterprise/app_instance_spec.rb
414
+ - spec/models/mno_enterprise/app_spec.rb
415
+ - spec/models/mno_enterprise/base_resource_spec.rb
416
+ - spec/models/mno_enterprise/deletion_request_spec.rb
417
+ - spec/models/mno_enterprise/invoice_spec.rb
418
+ - spec/models/mno_enterprise/organization_spec.rb
419
+ - spec/models/mno_enterprise/user_spec.rb
420
+ - spec/rails_helper.rb
421
+ - spec/spec_helper.rb