auction_fun_core 0.8.9 → 0.8.10
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/auction_fun_core.gemspec +1 -1
- data/lib/auction_fun_core/version.rb +1 -1
- data/spec/auction_fun_core/contracts/auction_context/create_contract_spec.rb +158 -0
- data/spec/auction_fun_core/contracts/auction_context/post_auction/participant_contract_spec.rb +77 -0
- data/spec/auction_fun_core/contracts/auction_context/post_auction/winner_contract_spec.rb +76 -0
- data/spec/auction_fun_core/contracts/auction_context/pre_auction/auction_start_reminder_contract_spec.rb +48 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/finish/closed_contract_spec.rb +59 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/finish/penny_contract_spec.rb +59 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/finish/standard_contract_spec.rb +59 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/pause_contract_spec.rb +39 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/start_contract_spec.rb +59 -0
- data/spec/auction_fun_core/contracts/auction_context/processor/unpause_contract_spec.rb +39 -0
- data/spec/auction_fun_core/contracts/bid_context/create_bid_closed_contract_spec.rb +130 -0
- data/spec/auction_fun_core/contracts/bid_context/create_bid_penny_contract_spec.rb +118 -0
- data/spec/auction_fun_core/contracts/bid_context/create_bid_standard_contract_spec.rb +154 -0
- data/spec/auction_fun_core/contracts/staff_context/authentication_contract_spec.rb +89 -0
- data/spec/auction_fun_core/contracts/staff_context/registration_contract_spec.rb +24 -0
- data/spec/auction_fun_core/contracts/user_context/authentication_contract_spec.rb +89 -0
- data/spec/auction_fun_core/contracts/user_context/email_confirmation_contract_spec.rb +54 -0
- data/spec/auction_fun_core/contracts/user_context/phone_confirmation_contract_spec.rb +54 -0
- data/spec/auction_fun_core/contracts/user_context/registration_contract_spec.rb +27 -0
- data/spec/auction_fun_core/entities/auction_spec.rb +75 -0
- data/spec/auction_fun_core/entities/bid_spec.rb +7 -0
- data/spec/auction_fun_core/entities/staff_spec.rb +38 -0
- data/spec/auction_fun_core/entities/user_spec.rb +106 -0
- data/spec/auction_fun_core/operations/auction_context/create_operation_spec.rb +126 -0
- data/spec/auction_fun_core/operations/auction_context/post_auction/participant_operation_spec.rb +88 -0
- data/spec/auction_fun_core/operations/auction_context/post_auction/winner_operation_spec.rb +76 -0
- data/spec/auction_fun_core/operations/auction_context/pre_auction/auction_start_reminder_operation_spec.rb +98 -0
- data/spec/auction_fun_core/operations/auction_context/processor/finish/closed_operation_spec.rb +107 -0
- data/spec/auction_fun_core/operations/auction_context/processor/finish/penny_operation_spec.rb +107 -0
- data/spec/auction_fun_core/operations/auction_context/processor/finish/standard_operation_spec.rb +106 -0
- data/spec/auction_fun_core/operations/auction_context/processor/pause_operation_spec.rb +83 -0
- data/spec/auction_fun_core/operations/auction_context/processor/start_operation_spec.rb +147 -0
- data/spec/auction_fun_core/operations/auction_context/processor/unpause_operation_spec.rb +80 -0
- data/spec/auction_fun_core/operations/bid_context/create_bid_closed_operation_spec.rb +95 -0
- data/spec/auction_fun_core/operations/bid_context/create_bid_penny_operation_spec.rb +133 -0
- data/spec/auction_fun_core/operations/bid_context/create_bid_standard_operation_spec.rb +95 -0
- data/spec/auction_fun_core/operations/staff_context/authentication_operation_spec.rb +74 -0
- data/spec/auction_fun_core/operations/staff_context/registration_operation_spec.rb +93 -0
- data/spec/auction_fun_core/operations/user_context/authentication_operation_spec.rb +74 -0
- data/spec/auction_fun_core/operations/user_context/email_confirmation_operation_spec.rb +76 -0
- data/spec/auction_fun_core/operations/user_context/phone_confirmation_operation_spec.rb +76 -0
- data/spec/auction_fun_core/operations/user_context/registration_operation_spec.rb +100 -0
- data/spec/auction_fun_core/relations/auctions_spec.rb +471 -0
- data/spec/auction_fun_core/repos/auction_context/auction_repository_spec.rb +64 -0
- data/spec/auction_fun_core/repos/bid_context/bid_repository_spec.rb +64 -0
- data/spec/auction_fun_core/repos/staff_context/staff_repository_spec.rb +118 -0
- data/spec/auction_fun_core/repos/user_context/user_repository_spec.rb +117 -0
- data/spec/auction_fun_core/services/mail/auction_context/post_auction/participant_mailer_spec.rb +48 -0
- data/spec/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer_spec.rb +48 -0
- data/spec/auction_fun_core/services/mail/auction_context/pre_auction/auction_start_reminder_mailer_spec.rb +40 -0
- data/spec/auction_fun_core/services/mail/user_context/registration_mailer_spec.rb +33 -0
- data/spec/auction_fun_core/workers/operations/auction_context/post_auction/participation_operation_job_spec.rb +54 -0
- data/spec/auction_fun_core/workers/operations/auction_context/post_auction/winner_operation_job_spec.rb +48 -0
- data/spec/auction_fun_core/workers/operations/auction_context/pre_auction/auction_start_reminder_operation_job_spec.rb +53 -0
- data/spec/auction_fun_core/workers/operations/auction_context/processor/finish/closed_operation_job_spec.rb +47 -0
- data/spec/auction_fun_core/workers/operations/auction_context/processor/finish/penny_operation_job_spec.rb +47 -0
- data/spec/auction_fun_core/workers/operations/auction_context/processor/finish/standard_operation_job_spec.rb +47 -0
- data/spec/auction_fun_core/workers/operations/auction_context/processor/start_operation_job_spec.rb +47 -0
- data/spec/auction_fun_core/workers/services/mail/auction_context/post_auction/participant_mailer_job_spec.rb +62 -0
- data/spec/auction_fun_core/workers/services/mail/auction_context/post_auction/pre_auction/auction_start_reminder_mailer_job_spec.rb +59 -0
- data/spec/auction_fun_core/workers/services/mail/auction_context/post_auction/winner_mailer_job_spec.rb +62 -0
- data/spec/auction_fun_core/workers/services/mail/user_context/registration_mailer_job_spec.rb +53 -0
- data/spec/auction_fun_core_spec.rb +7 -0
- data/spec/spec_helper.rb +61 -0
- data/spec/support/background_job.rb +7 -0
- data/spec/support/factories/auctions.rb +143 -0
- data/spec/support/factories/bids.rb +6 -0
- data/spec/support/factories/staffs.rb +18 -0
- data/spec/support/factories/users.rb +43 -0
- data/spec/support/faker.rb +6 -0
- data/spec/support/mail.rb +13 -0
- data/spec/support/shared_examples/validate_email_contract.rb +25 -0
- data/spec/support/shared_examples/validate_name_contract.rb +19 -0
- data/spec/support/shared_examples/validate_password_confirmation_contract.rb +16 -0
- data/spec/support/shared_examples/validate_password_contract.rb +18 -0
- data/spec/support/shared_examples/validate_phone_contract.rb +25 -0
- data/spec/support/shared_examples/validate_stopwatch_contract.rb +32 -0
- metadata +79 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "validate_name_contract" do |factory_name|
|
|
4
|
+
let(:min) { AuctionFunCore::Business::Configuration::MIN_NAME_LENGTH }
|
|
5
|
+
let(:max) { AuctionFunCore::Business::Configuration::MAX_NAME_LENGTH }
|
|
6
|
+
let(:factory) { Factory[factory_name] }
|
|
7
|
+
|
|
8
|
+
context "when the characters in the name are outside the allowed range" do
|
|
9
|
+
let(:attributes) { {name: "abc"} }
|
|
10
|
+
|
|
11
|
+
it "expect failure with error messages" do
|
|
12
|
+
expect(subject).to be_failure
|
|
13
|
+
|
|
14
|
+
expect(subject.errors[:name]).to include(
|
|
15
|
+
I18n.t("contracts.errors.custom.macro.name_format", min: min, max: max)
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "validate_password_confirmation_contract" do |factory_name|
|
|
4
|
+
let(:factory) { Factory[factory_name] }
|
|
5
|
+
|
|
6
|
+
context "when password characters are outside the allowed range" do
|
|
7
|
+
let(:attributes) { {password: "password", password_confirmation: "1234567"} }
|
|
8
|
+
|
|
9
|
+
it "expect failure with error messages" do
|
|
10
|
+
expect(contract).to be_failure
|
|
11
|
+
expect(contract.errors[:password_confirmation]).to include(
|
|
12
|
+
I18n.t("contracts.errors.custom.default.password_confirmation")
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "validate_password_contract" do |factory_name|
|
|
4
|
+
let(:min) { AuctionFunCore::Business::Configuration::MIN_PASSWORD_LENGTH }
|
|
5
|
+
let(:max) { AuctionFunCore::Business::Configuration::MAX_PASSWORD_LENGTH }
|
|
6
|
+
let(:factory) { Factory[factory_name] }
|
|
7
|
+
|
|
8
|
+
context "when password characters are outside the allowed range" do
|
|
9
|
+
let(:attributes) { {password: "123", password_confirmation: "123"} }
|
|
10
|
+
|
|
11
|
+
it "expect failure with error messages" do
|
|
12
|
+
expect(contract).to be_failure
|
|
13
|
+
expect(contract.errors[:password]).to include(
|
|
14
|
+
I18n.t("contracts.errors.custom.macro.password_format", min: min, max: max)
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "validate_phone_contract" do |factory_name|
|
|
4
|
+
let(:factory) { Factory[factory_name] }
|
|
5
|
+
|
|
6
|
+
context "when phone is in wrong format" do
|
|
7
|
+
let(:attributes) { {phone: "12345"} }
|
|
8
|
+
|
|
9
|
+
it "expect failure with error messages" do
|
|
10
|
+
expect(subject).to be_failure
|
|
11
|
+
|
|
12
|
+
expect(subject.errors[:phone]).to include(I18n.t("contracts.errors.custom.macro.phone_format"))
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
context "when phone is already exists on database" do
|
|
17
|
+
let(:attributes) { {phone: factory.phone} }
|
|
18
|
+
|
|
19
|
+
it "expect failure with error messages" do
|
|
20
|
+
expect(subject).to be_failure
|
|
21
|
+
|
|
22
|
+
expect(subject.errors[:phone]).to include(I18n.t("contracts.errors.custom.default.taken"))
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
shared_examples "validate_stopwatch_contract" do
|
|
4
|
+
let(:min) { AuctionFunCore::Business::Configuration::AUCTION_STOPWATCH_MIN_VALUE }
|
|
5
|
+
let(:max) { AuctionFunCore::Business::Configuration::AUCTION_STOPWATCH_MAX_VALUE }
|
|
6
|
+
|
|
7
|
+
context "when kind is penny and stopwatch is blank" do
|
|
8
|
+
let(:attributes) { {auction_id: auction.id, kind: auction.kind} }
|
|
9
|
+
|
|
10
|
+
it "expect failure with error message" do
|
|
11
|
+
expect(contract).to be_failure
|
|
12
|
+
expect(contract.errors[:stopwatch]).to include(I18n.t("contracts.errors.filled?"))
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
context "when kind is penny and stopwatch is not within the allowed range" do
|
|
17
|
+
let(:attributes) do
|
|
18
|
+
{
|
|
19
|
+
auction_id: auction.id,
|
|
20
|
+
kind: auction.kind,
|
|
21
|
+
stopwatch: max + 1
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "expect failure with error message" do
|
|
26
|
+
expect(contract).to be_failure
|
|
27
|
+
expect(contract.errors[:stopwatch]).to include(
|
|
28
|
+
I18n.t("contracts.errors.included_in?.arg.range", list_left: min, list_right: max)
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: auction_fun_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ricardo Pacheco
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-04-
|
|
11
|
+
date: 2024-04-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -408,6 +408,83 @@ files:
|
|
|
408
408
|
- lib/auction_fun_core/workers/services/mail/auction_context/pre_auction/auction_start_reminder_mailer_job.rb
|
|
409
409
|
- lib/auction_fun_core/workers/services/mail/user_context/registration_mailer_job.rb
|
|
410
410
|
- lib/tasks/database.rake
|
|
411
|
+
- spec/auction_fun_core/contracts/auction_context/create_contract_spec.rb
|
|
412
|
+
- spec/auction_fun_core/contracts/auction_context/post_auction/participant_contract_spec.rb
|
|
413
|
+
- spec/auction_fun_core/contracts/auction_context/post_auction/winner_contract_spec.rb
|
|
414
|
+
- spec/auction_fun_core/contracts/auction_context/pre_auction/auction_start_reminder_contract_spec.rb
|
|
415
|
+
- spec/auction_fun_core/contracts/auction_context/processor/finish/closed_contract_spec.rb
|
|
416
|
+
- spec/auction_fun_core/contracts/auction_context/processor/finish/penny_contract_spec.rb
|
|
417
|
+
- spec/auction_fun_core/contracts/auction_context/processor/finish/standard_contract_spec.rb
|
|
418
|
+
- spec/auction_fun_core/contracts/auction_context/processor/pause_contract_spec.rb
|
|
419
|
+
- spec/auction_fun_core/contracts/auction_context/processor/start_contract_spec.rb
|
|
420
|
+
- spec/auction_fun_core/contracts/auction_context/processor/unpause_contract_spec.rb
|
|
421
|
+
- spec/auction_fun_core/contracts/bid_context/create_bid_closed_contract_spec.rb
|
|
422
|
+
- spec/auction_fun_core/contracts/bid_context/create_bid_penny_contract_spec.rb
|
|
423
|
+
- spec/auction_fun_core/contracts/bid_context/create_bid_standard_contract_spec.rb
|
|
424
|
+
- spec/auction_fun_core/contracts/staff_context/authentication_contract_spec.rb
|
|
425
|
+
- spec/auction_fun_core/contracts/staff_context/registration_contract_spec.rb
|
|
426
|
+
- spec/auction_fun_core/contracts/user_context/authentication_contract_spec.rb
|
|
427
|
+
- spec/auction_fun_core/contracts/user_context/email_confirmation_contract_spec.rb
|
|
428
|
+
- spec/auction_fun_core/contracts/user_context/phone_confirmation_contract_spec.rb
|
|
429
|
+
- spec/auction_fun_core/contracts/user_context/registration_contract_spec.rb
|
|
430
|
+
- spec/auction_fun_core/entities/auction_spec.rb
|
|
431
|
+
- spec/auction_fun_core/entities/bid_spec.rb
|
|
432
|
+
- spec/auction_fun_core/entities/staff_spec.rb
|
|
433
|
+
- spec/auction_fun_core/entities/user_spec.rb
|
|
434
|
+
- spec/auction_fun_core/operations/auction_context/create_operation_spec.rb
|
|
435
|
+
- spec/auction_fun_core/operations/auction_context/post_auction/participant_operation_spec.rb
|
|
436
|
+
- spec/auction_fun_core/operations/auction_context/post_auction/winner_operation_spec.rb
|
|
437
|
+
- spec/auction_fun_core/operations/auction_context/pre_auction/auction_start_reminder_operation_spec.rb
|
|
438
|
+
- spec/auction_fun_core/operations/auction_context/processor/finish/closed_operation_spec.rb
|
|
439
|
+
- spec/auction_fun_core/operations/auction_context/processor/finish/penny_operation_spec.rb
|
|
440
|
+
- spec/auction_fun_core/operations/auction_context/processor/finish/standard_operation_spec.rb
|
|
441
|
+
- spec/auction_fun_core/operations/auction_context/processor/pause_operation_spec.rb
|
|
442
|
+
- spec/auction_fun_core/operations/auction_context/processor/start_operation_spec.rb
|
|
443
|
+
- spec/auction_fun_core/operations/auction_context/processor/unpause_operation_spec.rb
|
|
444
|
+
- spec/auction_fun_core/operations/bid_context/create_bid_closed_operation_spec.rb
|
|
445
|
+
- spec/auction_fun_core/operations/bid_context/create_bid_penny_operation_spec.rb
|
|
446
|
+
- spec/auction_fun_core/operations/bid_context/create_bid_standard_operation_spec.rb
|
|
447
|
+
- spec/auction_fun_core/operations/staff_context/authentication_operation_spec.rb
|
|
448
|
+
- spec/auction_fun_core/operations/staff_context/registration_operation_spec.rb
|
|
449
|
+
- spec/auction_fun_core/operations/user_context/authentication_operation_spec.rb
|
|
450
|
+
- spec/auction_fun_core/operations/user_context/email_confirmation_operation_spec.rb
|
|
451
|
+
- spec/auction_fun_core/operations/user_context/phone_confirmation_operation_spec.rb
|
|
452
|
+
- spec/auction_fun_core/operations/user_context/registration_operation_spec.rb
|
|
453
|
+
- spec/auction_fun_core/relations/auctions_spec.rb
|
|
454
|
+
- spec/auction_fun_core/repos/auction_context/auction_repository_spec.rb
|
|
455
|
+
- spec/auction_fun_core/repos/bid_context/bid_repository_spec.rb
|
|
456
|
+
- spec/auction_fun_core/repos/staff_context/staff_repository_spec.rb
|
|
457
|
+
- spec/auction_fun_core/repos/user_context/user_repository_spec.rb
|
|
458
|
+
- spec/auction_fun_core/services/mail/auction_context/post_auction/participant_mailer_spec.rb
|
|
459
|
+
- spec/auction_fun_core/services/mail/auction_context/post_auction/winner_mailer_spec.rb
|
|
460
|
+
- spec/auction_fun_core/services/mail/auction_context/pre_auction/auction_start_reminder_mailer_spec.rb
|
|
461
|
+
- spec/auction_fun_core/services/mail/user_context/registration_mailer_spec.rb
|
|
462
|
+
- spec/auction_fun_core/workers/operations/auction_context/post_auction/participation_operation_job_spec.rb
|
|
463
|
+
- spec/auction_fun_core/workers/operations/auction_context/post_auction/winner_operation_job_spec.rb
|
|
464
|
+
- spec/auction_fun_core/workers/operations/auction_context/pre_auction/auction_start_reminder_operation_job_spec.rb
|
|
465
|
+
- spec/auction_fun_core/workers/operations/auction_context/processor/finish/closed_operation_job_spec.rb
|
|
466
|
+
- spec/auction_fun_core/workers/operations/auction_context/processor/finish/penny_operation_job_spec.rb
|
|
467
|
+
- spec/auction_fun_core/workers/operations/auction_context/processor/finish/standard_operation_job_spec.rb
|
|
468
|
+
- spec/auction_fun_core/workers/operations/auction_context/processor/start_operation_job_spec.rb
|
|
469
|
+
- spec/auction_fun_core/workers/services/mail/auction_context/post_auction/participant_mailer_job_spec.rb
|
|
470
|
+
- spec/auction_fun_core/workers/services/mail/auction_context/post_auction/pre_auction/auction_start_reminder_mailer_job_spec.rb
|
|
471
|
+
- spec/auction_fun_core/workers/services/mail/auction_context/post_auction/winner_mailer_job_spec.rb
|
|
472
|
+
- spec/auction_fun_core/workers/services/mail/user_context/registration_mailer_job_spec.rb
|
|
473
|
+
- spec/auction_fun_core_spec.rb
|
|
474
|
+
- spec/spec_helper.rb
|
|
475
|
+
- spec/support/background_job.rb
|
|
476
|
+
- spec/support/factories/auctions.rb
|
|
477
|
+
- spec/support/factories/bids.rb
|
|
478
|
+
- spec/support/factories/staffs.rb
|
|
479
|
+
- spec/support/factories/users.rb
|
|
480
|
+
- spec/support/faker.rb
|
|
481
|
+
- spec/support/mail.rb
|
|
482
|
+
- spec/support/shared_examples/validate_email_contract.rb
|
|
483
|
+
- spec/support/shared_examples/validate_name_contract.rb
|
|
484
|
+
- spec/support/shared_examples/validate_password_confirmation_contract.rb
|
|
485
|
+
- spec/support/shared_examples/validate_password_contract.rb
|
|
486
|
+
- spec/support/shared_examples/validate_phone_contract.rb
|
|
487
|
+
- spec/support/shared_examples/validate_stopwatch_contract.rb
|
|
411
488
|
- system/providers/background_job.rb
|
|
412
489
|
- system/providers/core.rb
|
|
413
490
|
- system/providers/db.rb
|