commons_yellowme 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +10 -0
- data/.rspec +3 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +234 -0
- data/bin/test +5 -0
- data/commons.gemspec +43 -0
- data/lib/commons/version.rb +1 -1
- data/spec/commons/authentication/authenticate_by_jwt_spec.rb +37 -0
- data/spec/commons/authentication/json_web_token_spec.rb +41 -0
- data/spec/commons/concerns/attributes/sex_spec.rb +24 -0
- data/spec/commons/concerns/extensions/deleted_spec.rb +42 -0
- data/spec/commons/concerns/guard/capitalizable_spec.rb +13 -0
- data/spec/commons/concerns/validations/undestroyable_spec.rb +9 -0
- data/spec/commons/errors/bad_request_spec.rb +62 -0
- data/spec/commons/errors/conflict_spec.rb +62 -0
- data/spec/commons/errors/forbidden_spec.rb +62 -0
- data/spec/commons/errors/internal_server_error_spec.rb +62 -0
- data/spec/commons/errors/invalid_resource_spec.rb +62 -0
- data/spec/commons/errors/maintenance_mode_spec.rb +49 -0
- data/spec/commons/errors/missing_parameter_spec.rb +49 -0
- data/spec/commons/errors/not_unique_spec.rb +62 -0
- data/spec/commons/errors/payment_required_spec.rb +62 -0
- data/spec/commons/errors/precondition_failed_spec.rb +62 -0
- data/spec/commons/errors/resource_not_found_spec.rb +49 -0
- data/spec/commons/errors/route_not_found_spec.rb +49 -0
- data/spec/commons/errors/unauthorized_spec.rb +62 -0
- data/spec/commons/errors/unprocessable_entity_spec.rb +62 -0
- data/spec/commons/formatter/e164_phone_spec.rb +155 -0
- data/spec/commons/formatter/regex_constants_spec.rb +102 -0
- data/spec/commons/formatter/string_utils_spec.rb +19 -0
- data/spec/commons/repositories/base_repository_spec.rb +504 -0
- data/spec/commons/repositories/catalogs/base_catalog_spec.rb +55 -0
- data/spec/commons/serializers/bad_request_spec.rb +46 -0
- data/spec/commons/serializers/conflict_spec.rb +46 -0
- data/spec/commons/serializers/forbidden_spec.rb +46 -0
- data/spec/commons/serializers/internal_server_error_spec.rb +46 -0
- data/spec/commons/serializers/invalid_resource_spec.rb +46 -0
- data/spec/commons/serializers/maintenance_mode_spec.rb +46 -0
- data/spec/commons/serializers/missing_parameter_spec.rb +44 -0
- data/spec/commons/serializers/not_unique_spec.rb +46 -0
- data/spec/commons/serializers/payment_required_spec.rb +46 -0
- data/spec/commons/serializers/precondition_failed_spec.rb +46 -0
- data/spec/commons/serializers/route_not_found_spec.rb +46 -0
- data/spec/commons/serializers/unauthorized_spec.rb +46 -0
- data/spec/commons/serializers/unprocessable_entity_spec.rb +46 -0
- data/spec/commons/shared-examples/user_spec.rb +18 -0
- data/spec/dummy/.ruby-version +1 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +2 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +2 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/controllers/miscellaneous_controller.rb +13 -0
- data/spec/dummy/app/errors/default_handling.rb +35 -0
- data/spec/dummy/app/errors/error_notifier.rb +12 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/javascript/packs/application.js +15 -0
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/models/catalogs/application_parameter.rb +6 -0
- data/spec/dummy/app/models/concerns/.keep +0 -0
- data/spec/dummy/app/models/employee.rb +3 -0
- data/spec/dummy/app/models/user.rb +16 -0
- data/spec/dummy/app/repositories/catalogs/application_parameter_repository.rb +4 -0
- data/spec/dummy/app/repositories/employee_repository.rb +2 -0
- data/spec/dummy/app/repositories/user_repository.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +33 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +29 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +62 -0
- data/spec/dummy/config/environments/production.rb +112 -0
- data/spec/dummy/config/environments/test.rb +48 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +12 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/content_security_policy.rb +28 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +38 -0
- data/spec/dummy/config/routes.rb +9 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/storage.yml +34 -0
- data/spec/dummy/db/migrate/20191212233443_create_user.rb +13 -0
- data/spec/dummy/db/migrate/20191213072543_create_application_parameters.rb +8 -0
- data/spec/dummy/db/migrate/20200101204534_create_employee.rb +8 -0
- data/spec/dummy/db/schema.rb +35 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/catalogs/application_parameters.rb +6 -0
- data/spec/factories/employees.rb +6 -0
- data/spec/factories/users.rb +7 -0
- data/spec/rails_helper.rb +68 -0
- data/spec/spec_helper.rb +104 -0
- data/spec/support/.DS_Store +0 -0
- data/spec/support/shared-examples/capitalizable.rb +16 -0
- data/spec/support/shared-examples/deletable.rb +39 -0
- data/spec/support/shared-examples/dimorphic.rb +28 -0
- data/spec/support/shared-examples/stripable.rb +17 -0
- data/spec/support/shared-examples/undestroyable.rb +8 -0
- metadata +240 -3
@@ -0,0 +1,68 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
require 'spec_helper'
|
3
|
+
ENV['RAILS_ENV'] ||= 'test'
|
4
|
+
|
5
|
+
require File.expand_path('dummy/config/environment', __dir__)
|
6
|
+
|
7
|
+
# Prevent database truncation if the environment is production
|
8
|
+
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
9
|
+
require 'rspec/rails'
|
10
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
11
|
+
require 'factory_bot_rails'
|
12
|
+
require 'faker'
|
13
|
+
|
14
|
+
Commons.secret_key_base = 'xxxxx'
|
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
|
+
#
|
24
|
+
# The following line is provided for convenience purposes. It has the downside
|
25
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
26
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
27
|
+
# require only the support files necessary.
|
28
|
+
#
|
29
|
+
# Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
|
30
|
+
|
31
|
+
# Checks for pending migrations and applies them before tests are run.
|
32
|
+
# If you are not using ActiveRecord, you can remove these lines.
|
33
|
+
begin
|
34
|
+
ActiveRecord::Migration.maintain_test_schema!
|
35
|
+
rescue ActiveRecord::PendingMigrationError => e
|
36
|
+
puts e.to_s.strip
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
RSpec.configure do |config|
|
40
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
41
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
42
|
+
config.include FactoryBot::Syntax::Methods
|
43
|
+
|
44
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
45
|
+
# examples within a transaction, remove the following line or assign false
|
46
|
+
# instead of true.
|
47
|
+
config.use_transactional_fixtures = true
|
48
|
+
|
49
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
50
|
+
# based on their file location, for example enabling you to call `get` and
|
51
|
+
# `post` in specs under `spec/controllers`.
|
52
|
+
#
|
53
|
+
# You can disable this behaviour by removing the line below, and instead
|
54
|
+
# explicitly tag your specs with their type, e.g.:
|
55
|
+
#
|
56
|
+
# RSpec.describe UsersController, :type => :controller do
|
57
|
+
# # ...
|
58
|
+
# end
|
59
|
+
#
|
60
|
+
# The different available types are documented in the features, such as in
|
61
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
62
|
+
config.infer_spec_type_from_file_location!
|
63
|
+
|
64
|
+
# Filter lines from Rails gems in backtraces.
|
65
|
+
config.filter_rails_from_backtrace!
|
66
|
+
# arbitrary gems may also be filtered via:
|
67
|
+
# config.filter_gems_from_backtrace("gem name")
|
68
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
# This file was generated by the `rspec --init` 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
|
4
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
5
|
+
# files.
|
6
|
+
#
|
7
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
8
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
9
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
10
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
11
|
+
# a separate helper file that requires the additional dependencies and performs
|
12
|
+
# the additional setup, and require it from the spec files that actually need
|
13
|
+
# it.
|
14
|
+
#
|
15
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
16
|
+
require 'simplecov'
|
17
|
+
|
18
|
+
SimpleCov.start
|
19
|
+
|
20
|
+
RSpec.configure do |config|
|
21
|
+
# rspec-expectations config goes here. You can use an alternate
|
22
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
23
|
+
# assertions if you prefer.
|
24
|
+
config.expect_with :rspec do |expectations|
|
25
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
26
|
+
# and `failure_message` of custom matchers include text for helper methods
|
27
|
+
# defined using `chain`, e.g.:
|
28
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
29
|
+
# # => "be bigger than 2 and smaller than 4"
|
30
|
+
# ...rather than:
|
31
|
+
# # => "be bigger than 2"
|
32
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
33
|
+
end
|
34
|
+
|
35
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
36
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
37
|
+
config.mock_with :rspec do |mocks|
|
38
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
39
|
+
# a real object. This is generally recommended, and will default to
|
40
|
+
# `true` in RSpec 4.
|
41
|
+
mocks.verify_partial_doubles = true
|
42
|
+
end
|
43
|
+
|
44
|
+
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
45
|
+
# have no way to turn it off -- the option exists only for backwards
|
46
|
+
# compatibility in RSpec 3). It causes shared context metadata to be
|
47
|
+
# inherited by the metadata hash of host groups and examples, rather than
|
48
|
+
# triggering implicit auto-inclusion in groups with matching metadata.
|
49
|
+
config.shared_context_metadata_behavior = :apply_to_host_groups
|
50
|
+
|
51
|
+
# The settings below are suggested to provide a good initial experience
|
52
|
+
# with RSpec, but feel free to customize to your heart's content.
|
53
|
+
=begin
|
54
|
+
# This allows you to limit a spec run to individual examples or groups
|
55
|
+
# you care about by tagging them with `:focus` metadata. When nothing
|
56
|
+
# is tagged with `:focus`, all examples get run. RSpec also provides
|
57
|
+
# aliases for `it`, `describe`, and `context` that include `:focus`
|
58
|
+
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
59
|
+
config.filter_run_when_matching :focus
|
60
|
+
|
61
|
+
# Allows RSpec to persist some state between runs in order to support
|
62
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
63
|
+
# you configure your source control system to ignore this file.
|
64
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
65
|
+
|
66
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
67
|
+
# recommended. For more details, see:
|
68
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
69
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
70
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
71
|
+
config.disable_monkey_patching!
|
72
|
+
|
73
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
74
|
+
# be too noisy due to issues in dependencies.
|
75
|
+
config.warnings = true
|
76
|
+
|
77
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
78
|
+
# file, and it's useful to allow more verbose output when running an
|
79
|
+
# individual spec file.
|
80
|
+
if config.files_to_run.one?
|
81
|
+
# Use the documentation formatter for detailed output,
|
82
|
+
# unless a formatter has already been configured
|
83
|
+
# (e.g. via a command-line flag).
|
84
|
+
config.default_formatter = "doc"
|
85
|
+
end
|
86
|
+
|
87
|
+
# Print the 10 slowest examples and example groups at the
|
88
|
+
# end of the spec run, to help surface which specs are running
|
89
|
+
# particularly slow.
|
90
|
+
config.profile_examples = 10
|
91
|
+
|
92
|
+
# Run specs in random order to surface order dependencies. If you find an
|
93
|
+
# order dependency and want to debug it, you can fix the order by providing
|
94
|
+
# the seed, which is printed after each run.
|
95
|
+
# --seed 1234
|
96
|
+
config.order = :random
|
97
|
+
|
98
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
99
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
100
|
+
# test failures related to randomization by passing the same `--seed` value
|
101
|
+
# as the one that triggered the failure.
|
102
|
+
Kernel.srand config.seed
|
103
|
+
=end
|
104
|
+
end
|
Binary file
|
@@ -0,0 +1,16 @@
|
|
1
|
+
RSpec.shared_examples_for "capitalizable" do |attrs|
|
2
|
+
let(:model) { described_class }
|
3
|
+
|
4
|
+
it "is capitalizable" do
|
5
|
+
params = {}
|
6
|
+
attrs.each do |attr|
|
7
|
+
params[attr] = Faker::Name.last_name.downcase
|
8
|
+
end
|
9
|
+
obj = FactoryBot.build(model.to_s.underscore.to_sym, params)
|
10
|
+
obj.valid?
|
11
|
+
attrs.each do |attr|
|
12
|
+
value = obj.instance_eval(attr.to_s)
|
13
|
+
expect(value).to eq Commons::Formatter::StringUtils.capitalize(params[attr])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
RSpec.shared_examples_for "deletable" do |attrs|
|
2
|
+
let(:model) { described_class }
|
3
|
+
|
4
|
+
describe "works ok!" do
|
5
|
+
let(:obj) { FactoryBot.create(model.to_s.underscore.to_sym) }
|
6
|
+
subject do
|
7
|
+
obj
|
8
|
+
end
|
9
|
+
|
10
|
+
it "when model deleted" do
|
11
|
+
model = subject
|
12
|
+
model.deleted_at = Time.current
|
13
|
+
model.save
|
14
|
+
expect(model.deleted?).to be true
|
15
|
+
end
|
16
|
+
|
17
|
+
it "when model deleted do update" do
|
18
|
+
model = subject
|
19
|
+
model.deleted_at = Time.current
|
20
|
+
model.save
|
21
|
+
model.created_at = Time.current
|
22
|
+
expect{model.save}.to raise_error(ActiveRecord::RecordInvalid)
|
23
|
+
end
|
24
|
+
|
25
|
+
it "when model not deleted" do
|
26
|
+
model = subject
|
27
|
+
model.deleted_at = nil
|
28
|
+
model.save
|
29
|
+
expect(subject.deleted?).to be false
|
30
|
+
end
|
31
|
+
|
32
|
+
it "when model not deleted save" do
|
33
|
+
model = subject
|
34
|
+
model.deleted_at = nil
|
35
|
+
model.created_at = Time.current
|
36
|
+
expect{model.save}.not_to raise_error
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
RSpec.shared_examples_for "dimorphic" do |attrs|
|
2
|
+
let(:model) { described_class }
|
3
|
+
|
4
|
+
describe "works ok!" do
|
5
|
+
let(:sex) { Commons::Concerns::Attributes::Sex::FEMALE }
|
6
|
+
let(:obj) { FactoryBot.build(model.to_s.underscore.to_sym) }
|
7
|
+
subject do
|
8
|
+
obj.sex = sex
|
9
|
+
obj
|
10
|
+
end
|
11
|
+
|
12
|
+
it "when value dimorphic" do
|
13
|
+
expect(subject.sex).to eq sex
|
14
|
+
expect(subject.female_sex?).to be true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "fails!" do
|
19
|
+
let(:obj) { FactoryBot.build(model.to_s.underscore.to_sym) }
|
20
|
+
subject do
|
21
|
+
obj.sex = 'random string'
|
22
|
+
end
|
23
|
+
|
24
|
+
it "when value not dimorphic" do
|
25
|
+
expect{ subject }.to raise_error(ArgumentError)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
RSpec.shared_examples_for "stripable" do |attrs|
|
2
|
+
let(:model) { described_class }
|
3
|
+
let(:dirty_string) { ' First Second ' }
|
4
|
+
|
5
|
+
it "is stripable" do
|
6
|
+
params = {}
|
7
|
+
attrs.each do |attr|
|
8
|
+
params[attr] = dirty_string
|
9
|
+
end
|
10
|
+
obj = FactoryBot.build(model.to_s.underscore.to_sym, params)
|
11
|
+
obj.update!(params)
|
12
|
+
attrs.each do |attr|
|
13
|
+
value = obj.instance_eval(attr.to_s)
|
14
|
+
expect(value).to eq params[attr].to_s.strip.squeeze(" ")
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commons_yellowme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yellowme
|
@@ -180,13 +180,20 @@ dependencies:
|
|
180
180
|
version: '0'
|
181
181
|
description: Commons is Yellowme's Rails APIs utilities gem
|
182
182
|
email: hola@yellowme.mx
|
183
|
-
executables:
|
183
|
+
executables:
|
184
|
+
- test
|
184
185
|
extensions: []
|
185
186
|
extra_rdoc_files: []
|
186
187
|
files:
|
188
|
+
- ".gitignore"
|
189
|
+
- ".rspec"
|
190
|
+
- Gemfile
|
191
|
+
- Gemfile.lock
|
187
192
|
- MIT-LICENSE
|
188
193
|
- README.md
|
189
194
|
- Rakefile
|
195
|
+
- bin/test
|
196
|
+
- commons.gemspec
|
190
197
|
- lib/commons.rb
|
191
198
|
- lib/commons/authentication/authenticate_by_jwt.rb
|
192
199
|
- lib/commons/authentication/json_web_token.rb
|
@@ -227,6 +234,121 @@ files:
|
|
227
234
|
- lib/commons/services/concerns/callable.rb
|
228
235
|
- lib/commons/version.rb
|
229
236
|
- lib/tasks/commons_tasks.rake
|
237
|
+
- spec/commons/authentication/authenticate_by_jwt_spec.rb
|
238
|
+
- spec/commons/authentication/json_web_token_spec.rb
|
239
|
+
- spec/commons/concerns/attributes/sex_spec.rb
|
240
|
+
- spec/commons/concerns/extensions/deleted_spec.rb
|
241
|
+
- spec/commons/concerns/guard/capitalizable_spec.rb
|
242
|
+
- spec/commons/concerns/validations/undestroyable_spec.rb
|
243
|
+
- spec/commons/errors/bad_request_spec.rb
|
244
|
+
- spec/commons/errors/conflict_spec.rb
|
245
|
+
- spec/commons/errors/forbidden_spec.rb
|
246
|
+
- spec/commons/errors/internal_server_error_spec.rb
|
247
|
+
- spec/commons/errors/invalid_resource_spec.rb
|
248
|
+
- spec/commons/errors/maintenance_mode_spec.rb
|
249
|
+
- spec/commons/errors/missing_parameter_spec.rb
|
250
|
+
- spec/commons/errors/not_unique_spec.rb
|
251
|
+
- spec/commons/errors/payment_required_spec.rb
|
252
|
+
- spec/commons/errors/precondition_failed_spec.rb
|
253
|
+
- spec/commons/errors/resource_not_found_spec.rb
|
254
|
+
- spec/commons/errors/route_not_found_spec.rb
|
255
|
+
- spec/commons/errors/unauthorized_spec.rb
|
256
|
+
- spec/commons/errors/unprocessable_entity_spec.rb
|
257
|
+
- spec/commons/formatter/e164_phone_spec.rb
|
258
|
+
- spec/commons/formatter/regex_constants_spec.rb
|
259
|
+
- spec/commons/formatter/string_utils_spec.rb
|
260
|
+
- spec/commons/repositories/base_repository_spec.rb
|
261
|
+
- spec/commons/repositories/catalogs/base_catalog_spec.rb
|
262
|
+
- spec/commons/serializers/bad_request_spec.rb
|
263
|
+
- spec/commons/serializers/conflict_spec.rb
|
264
|
+
- spec/commons/serializers/forbidden_spec.rb
|
265
|
+
- spec/commons/serializers/internal_server_error_spec.rb
|
266
|
+
- spec/commons/serializers/invalid_resource_spec.rb
|
267
|
+
- spec/commons/serializers/maintenance_mode_spec.rb
|
268
|
+
- spec/commons/serializers/missing_parameter_spec.rb
|
269
|
+
- spec/commons/serializers/not_unique_spec.rb
|
270
|
+
- spec/commons/serializers/payment_required_spec.rb
|
271
|
+
- spec/commons/serializers/precondition_failed_spec.rb
|
272
|
+
- spec/commons/serializers/route_not_found_spec.rb
|
273
|
+
- spec/commons/serializers/unauthorized_spec.rb
|
274
|
+
- spec/commons/serializers/unprocessable_entity_spec.rb
|
275
|
+
- spec/commons/shared-examples/user_spec.rb
|
276
|
+
- spec/dummy/.ruby-version
|
277
|
+
- spec/dummy/Rakefile
|
278
|
+
- spec/dummy/app/assets/config/manifest.js
|
279
|
+
- spec/dummy/app/assets/images/.keep
|
280
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
281
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
282
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
283
|
+
- spec/dummy/app/controllers/application_controller.rb
|
284
|
+
- spec/dummy/app/controllers/concerns/.keep
|
285
|
+
- spec/dummy/app/controllers/miscellaneous_controller.rb
|
286
|
+
- spec/dummy/app/errors/default_handling.rb
|
287
|
+
- spec/dummy/app/errors/error_notifier.rb
|
288
|
+
- spec/dummy/app/helpers/application_helper.rb
|
289
|
+
- spec/dummy/app/javascript/packs/application.js
|
290
|
+
- spec/dummy/app/jobs/application_job.rb
|
291
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
292
|
+
- spec/dummy/app/models/application_record.rb
|
293
|
+
- spec/dummy/app/models/catalogs/application_parameter.rb
|
294
|
+
- spec/dummy/app/models/concerns/.keep
|
295
|
+
- spec/dummy/app/models/employee.rb
|
296
|
+
- spec/dummy/app/models/user.rb
|
297
|
+
- spec/dummy/app/repositories/catalogs/application_parameter_repository.rb
|
298
|
+
- spec/dummy/app/repositories/employee_repository.rb
|
299
|
+
- spec/dummy/app/repositories/user_repository.rb
|
300
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
301
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
302
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
303
|
+
- spec/dummy/bin/rails
|
304
|
+
- spec/dummy/bin/rake
|
305
|
+
- spec/dummy/bin/setup
|
306
|
+
- spec/dummy/config.ru
|
307
|
+
- spec/dummy/config/application.rb
|
308
|
+
- spec/dummy/config/boot.rb
|
309
|
+
- spec/dummy/config/cable.yml
|
310
|
+
- spec/dummy/config/database.yml
|
311
|
+
- spec/dummy/config/environment.rb
|
312
|
+
- spec/dummy/config/environments/development.rb
|
313
|
+
- spec/dummy/config/environments/production.rb
|
314
|
+
- spec/dummy/config/environments/test.rb
|
315
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
316
|
+
- spec/dummy/config/initializers/assets.rb
|
317
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
318
|
+
- spec/dummy/config/initializers/content_security_policy.rb
|
319
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
320
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
321
|
+
- spec/dummy/config/initializers/inflections.rb
|
322
|
+
- spec/dummy/config/initializers/mime_types.rb
|
323
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
324
|
+
- spec/dummy/config/locales/en.yml
|
325
|
+
- spec/dummy/config/puma.rb
|
326
|
+
- spec/dummy/config/routes.rb
|
327
|
+
- spec/dummy/config/spring.rb
|
328
|
+
- spec/dummy/config/storage.yml
|
329
|
+
- spec/dummy/db/migrate/20191212233443_create_user.rb
|
330
|
+
- spec/dummy/db/migrate/20191213072543_create_application_parameters.rb
|
331
|
+
- spec/dummy/db/migrate/20200101204534_create_employee.rb
|
332
|
+
- spec/dummy/db/schema.rb
|
333
|
+
- spec/dummy/lib/assets/.keep
|
334
|
+
- spec/dummy/log/.keep
|
335
|
+
- spec/dummy/public/404.html
|
336
|
+
- spec/dummy/public/422.html
|
337
|
+
- spec/dummy/public/500.html
|
338
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
339
|
+
- spec/dummy/public/apple-touch-icon.png
|
340
|
+
- spec/dummy/public/favicon.ico
|
341
|
+
- spec/factories/catalogs/application_parameters.rb
|
342
|
+
- spec/factories/employees.rb
|
343
|
+
- spec/factories/users.rb
|
344
|
+
- spec/rails_helper.rb
|
345
|
+
- spec/spec_helper.rb
|
346
|
+
- spec/support/.DS_Store
|
347
|
+
- spec/support/shared-examples/capitalizable.rb
|
348
|
+
- spec/support/shared-examples/deletable.rb
|
349
|
+
- spec/support/shared-examples/dimorphic.rb
|
350
|
+
- spec/support/shared-examples/stripable.rb
|
351
|
+
- spec/support/shared-examples/undestroyable.rb
|
230
352
|
homepage: https://github.com/yellowme/commons-rails
|
231
353
|
licenses:
|
232
354
|
- MIT
|
@@ -251,4 +373,119 @@ rubygems_version: 2.7.6
|
|
251
373
|
signing_key:
|
252
374
|
specification_version: 4
|
253
375
|
summary: Commons is Yellowme's Rails APIs utilities gem
|
254
|
-
test_files:
|
376
|
+
test_files:
|
377
|
+
- spec/commons/authentication/authenticate_by_jwt_spec.rb
|
378
|
+
- spec/commons/authentication/json_web_token_spec.rb
|
379
|
+
- spec/commons/concerns/attributes/sex_spec.rb
|
380
|
+
- spec/commons/concerns/extensions/deleted_spec.rb
|
381
|
+
- spec/commons/concerns/guard/capitalizable_spec.rb
|
382
|
+
- spec/commons/concerns/validations/undestroyable_spec.rb
|
383
|
+
- spec/commons/errors/bad_request_spec.rb
|
384
|
+
- spec/commons/errors/conflict_spec.rb
|
385
|
+
- spec/commons/errors/forbidden_spec.rb
|
386
|
+
- spec/commons/errors/internal_server_error_spec.rb
|
387
|
+
- spec/commons/errors/invalid_resource_spec.rb
|
388
|
+
- spec/commons/errors/maintenance_mode_spec.rb
|
389
|
+
- spec/commons/errors/missing_parameter_spec.rb
|
390
|
+
- spec/commons/errors/not_unique_spec.rb
|
391
|
+
- spec/commons/errors/payment_required_spec.rb
|
392
|
+
- spec/commons/errors/precondition_failed_spec.rb
|
393
|
+
- spec/commons/errors/resource_not_found_spec.rb
|
394
|
+
- spec/commons/errors/route_not_found_spec.rb
|
395
|
+
- spec/commons/errors/unauthorized_spec.rb
|
396
|
+
- spec/commons/errors/unprocessable_entity_spec.rb
|
397
|
+
- spec/commons/formatter/e164_phone_spec.rb
|
398
|
+
- spec/commons/formatter/regex_constants_spec.rb
|
399
|
+
- spec/commons/formatter/string_utils_spec.rb
|
400
|
+
- spec/commons/repositories/base_repository_spec.rb
|
401
|
+
- spec/commons/repositories/catalogs/base_catalog_spec.rb
|
402
|
+
- spec/commons/serializers/bad_request_spec.rb
|
403
|
+
- spec/commons/serializers/conflict_spec.rb
|
404
|
+
- spec/commons/serializers/forbidden_spec.rb
|
405
|
+
- spec/commons/serializers/internal_server_error_spec.rb
|
406
|
+
- spec/commons/serializers/invalid_resource_spec.rb
|
407
|
+
- spec/commons/serializers/maintenance_mode_spec.rb
|
408
|
+
- spec/commons/serializers/missing_parameter_spec.rb
|
409
|
+
- spec/commons/serializers/not_unique_spec.rb
|
410
|
+
- spec/commons/serializers/payment_required_spec.rb
|
411
|
+
- spec/commons/serializers/precondition_failed_spec.rb
|
412
|
+
- spec/commons/serializers/route_not_found_spec.rb
|
413
|
+
- spec/commons/serializers/unauthorized_spec.rb
|
414
|
+
- spec/commons/serializers/unprocessable_entity_spec.rb
|
415
|
+
- spec/commons/shared-examples/user_spec.rb
|
416
|
+
- spec/dummy/.ruby-version
|
417
|
+
- spec/dummy/Rakefile
|
418
|
+
- spec/dummy/app/assets/config/manifest.js
|
419
|
+
- spec/dummy/app/assets/images/.keep
|
420
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
421
|
+
- spec/dummy/app/channels/application_cable/channel.rb
|
422
|
+
- spec/dummy/app/channels/application_cable/connection.rb
|
423
|
+
- spec/dummy/app/controllers/application_controller.rb
|
424
|
+
- spec/dummy/app/controllers/concerns/.keep
|
425
|
+
- spec/dummy/app/controllers/miscellaneous_controller.rb
|
426
|
+
- spec/dummy/app/errors/default_handling.rb
|
427
|
+
- spec/dummy/app/errors/error_notifier.rb
|
428
|
+
- spec/dummy/app/helpers/application_helper.rb
|
429
|
+
- spec/dummy/app/javascript/packs/application.js
|
430
|
+
- spec/dummy/app/jobs/application_job.rb
|
431
|
+
- spec/dummy/app/mailers/application_mailer.rb
|
432
|
+
- spec/dummy/app/models/application_record.rb
|
433
|
+
- spec/dummy/app/models/catalogs/application_parameter.rb
|
434
|
+
- spec/dummy/app/models/concerns/.keep
|
435
|
+
- spec/dummy/app/models/employee.rb
|
436
|
+
- spec/dummy/app/models/user.rb
|
437
|
+
- spec/dummy/app/repositories/catalogs/application_parameter_repository.rb
|
438
|
+
- spec/dummy/app/repositories/employee_repository.rb
|
439
|
+
- spec/dummy/app/repositories/user_repository.rb
|
440
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
441
|
+
- spec/dummy/app/views/layouts/mailer.html.erb
|
442
|
+
- spec/dummy/app/views/layouts/mailer.text.erb
|
443
|
+
- spec/dummy/bin/rails
|
444
|
+
- spec/dummy/bin/rake
|
445
|
+
- spec/dummy/bin/setup
|
446
|
+
- spec/dummy/config.ru
|
447
|
+
- spec/dummy/config/application.rb
|
448
|
+
- spec/dummy/config/boot.rb
|
449
|
+
- spec/dummy/config/cable.yml
|
450
|
+
- spec/dummy/config/database.yml
|
451
|
+
- spec/dummy/config/environment.rb
|
452
|
+
- spec/dummy/config/environments/development.rb
|
453
|
+
- spec/dummy/config/environments/production.rb
|
454
|
+
- spec/dummy/config/environments/test.rb
|
455
|
+
- spec/dummy/config/initializers/application_controller_renderer.rb
|
456
|
+
- spec/dummy/config/initializers/assets.rb
|
457
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
458
|
+
- spec/dummy/config/initializers/content_security_policy.rb
|
459
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
460
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
461
|
+
- spec/dummy/config/initializers/inflections.rb
|
462
|
+
- spec/dummy/config/initializers/mime_types.rb
|
463
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
464
|
+
- spec/dummy/config/locales/en.yml
|
465
|
+
- spec/dummy/config/puma.rb
|
466
|
+
- spec/dummy/config/routes.rb
|
467
|
+
- spec/dummy/config/spring.rb
|
468
|
+
- spec/dummy/config/storage.yml
|
469
|
+
- spec/dummy/db/migrate/20191212233443_create_user.rb
|
470
|
+
- spec/dummy/db/migrate/20191213072543_create_application_parameters.rb
|
471
|
+
- spec/dummy/db/migrate/20200101204534_create_employee.rb
|
472
|
+
- spec/dummy/db/schema.rb
|
473
|
+
- spec/dummy/lib/assets/.keep
|
474
|
+
- spec/dummy/log/.keep
|
475
|
+
- spec/dummy/public/404.html
|
476
|
+
- spec/dummy/public/422.html
|
477
|
+
- spec/dummy/public/500.html
|
478
|
+
- spec/dummy/public/apple-touch-icon-precomposed.png
|
479
|
+
- spec/dummy/public/apple-touch-icon.png
|
480
|
+
- spec/dummy/public/favicon.ico
|
481
|
+
- spec/factories/catalogs/application_parameters.rb
|
482
|
+
- spec/factories/employees.rb
|
483
|
+
- spec/factories/users.rb
|
484
|
+
- spec/rails_helper.rb
|
485
|
+
- spec/spec_helper.rb
|
486
|
+
- spec/support/.DS_Store
|
487
|
+
- spec/support/shared-examples/capitalizable.rb
|
488
|
+
- spec/support/shared-examples/deletable.rb
|
489
|
+
- spec/support/shared-examples/dimorphic.rb
|
490
|
+
- spec/support/shared-examples/stripable.rb
|
491
|
+
- spec/support/shared-examples/undestroyable.rb
|