egov_utils 0.4.16 → 0.4.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 468a3e3707028c65d702784c7954712c1e89e73c23bf84b61109d9caf73513bd
4
- data.tar.gz: 9aed28508bf75995324770966307ac293e630de58a46ee22c10572ea6a457d38
3
+ metadata.gz: 47cda9774483d83d1e270afa4840a6c2221cab71b4c2f7238ae02e1706c9df89
4
+ data.tar.gz: e24e20b2e28b788f6aab8174d74b5c0198d9208482029c971a28fe3856d86b71
5
5
  SHA512:
6
- metadata.gz: 7b5077fa2c120314964b8b62057762741d3839b64f84533896a21d348f81a03c76dc2837a4a860eb607c3b42805fb861a4addbfdaf2168f7d44d6e7818bf57bd
7
- data.tar.gz: ce5e980887007a9286bd9b7dd690e79870f25c0120400a9fa456e47be01730d077afbe58bdcc9d6291c8d0637d203147d6e5cf691164acf855bd47c2399e599d
6
+ metadata.gz: d53e1d8b7b291b4d052a4ce872043310a5510b8d8a2c0484111c9d6b45ae705e44ddf9dbfda12f85856e47cfeb5c7d8be8ff06faca35ca8f69020c71f55fe88e
7
+ data.tar.gz: 2062e2433f6cd864769dcabdeb2d7ee20614f8e2181c0bcf769a96130d34c920d4acefeb9909575d28125b4a8c5fccb30248bab13f091164f758d413838e66fe
@@ -1,3 +1,3 @@
1
1
  module EgovUtils
2
- VERSION = '0.4.16'
2
+ VERSION = '0.4.17'
3
3
  end
@@ -34,6 +34,7 @@ namespace :egov_utils do
34
34
  end
35
35
 
36
36
  task load_staging_data: [:require_factory_bot, :cleanup_db] do
37
+ FactoryBot.find_definitions if Rails.env.staging?
37
38
  require Rails.root.join('db', 'staging.rb')
38
39
  end
39
40
  end
@@ -0,0 +1,11 @@
1
+ FactoryBot.define do
2
+ factory :egov_utils_address, class: 'EgovUtils::Address' do
3
+ street { 'Vysoka' }
4
+ house_number { '156' }
5
+ orientation_number { '6a' }
6
+ city { 'Palermo' }
7
+ postcode { 42000 }
8
+ district { 'Hlavní město Praha' }
9
+ end
10
+
11
+ end
@@ -0,0 +1,8 @@
1
+ FactoryBot.define do
2
+ factory :egov_utils_group, class: 'EgovUtils::Group' do
3
+ name { 'EgovUsers' }
4
+ provider { 'main' }
5
+ ldap_uid { 'S-1-5-21-1698188384-1693678267-1543859470-6637' }
6
+ external_uid { 'DN=Linux,OU=Users,DC=test,DC=justice,DC=cz' }
7
+ end
8
+ end
@@ -0,0 +1,29 @@
1
+ FactoryBot.define do
2
+ factory :egov_utils_person, class: 'EgovUtils::Person' do
3
+ transient do
4
+ natural_attributes { Hash.new }
5
+ end
6
+ association :residence, factory: :egov_utils_address
7
+ joid { SecureRandom.uuid }
8
+ person_type { nil }
9
+ natural_person { nil }
10
+ legal_person { nil }
11
+
12
+ trait :natural do
13
+ person_type { 'natural' }
14
+ after(:build) do |person, evaluator|
15
+ evaluator.natural_person = FactoryBot.build(:egov_utils_natural_person, evaluator.natural_attributes.merge(person: person))
16
+ end
17
+ end
18
+
19
+ factory :natural_person, traits: [:natural]
20
+ end
21
+
22
+ factory :egov_utils_natural_person, class: 'EgovUtils::NaturalPerson' do
23
+ firstname { 'John' }
24
+ sequence(:lastname){|n| "Doe-#{n}"}
25
+ birth_date { Date.today - (Random.new.rand(50)+18).years }
26
+ association :person, factory: :egov_utils_person
27
+ end
28
+
29
+ end
@@ -0,0 +1,12 @@
1
+ FactoryBot.define do
2
+ factory :egov_utils_user, class: 'EgovUtils::User' do
3
+ firstname { 'John' }
4
+ lastname { 'Doe' }
5
+ login { mail }
6
+ sequence(:mail) {|n| "user#{n}@example.com"}
7
+ password { 'abcdef123456' }
8
+ password_confirmation { 'abcdef123456' }
9
+ active { true }
10
+ roles { [] }
11
+ end
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: egov_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.16
4
+ version: 0.4.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
@@ -567,6 +567,10 @@ files:
567
567
  - lib/egov_utils/version.rb
568
568
  - lib/grid/shield_grid.rb
569
569
  - lib/tasks/egov_utils_tasks.rake
570
+ - spec/factories/egov_utils_addresses.rb
571
+ - spec/factories/egov_utils_groups.rb
572
+ - spec/factories/egov_utils_people.rb
573
+ - spec/factories/egov_utils_users.rb
570
574
  - vendor/assets/fonts/Linotype.eot
571
575
  - vendor/assets/fonts/Linotype.ttf
572
576
  - vendor/assets/images/shieldui/editor.png