fine_print 6.0.2 → 6.0.3
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/lib/fine_print/version.rb +1 -1
- data/spec/factories/fine_print/contract.rb +26 -0
- data/spec/factories/fine_print/signature.rb +17 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9da35251ccce46e2160a907da2c391d9fef77c7668291bb8d9506e273b7bc09e
|
4
|
+
data.tar.gz: cf8cf946235b91dc0e4c57b45cab31082ff5fc08fa4aa612a59b55e97149bbcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3083f91474924d3e364788ca0fb1799d240882fd0ac0136dddd8d588aaad7a6680bf3332655c4a426de51c7dc16d76c287f85788755621fa4f1cab00e2ed89fa
|
7
|
+
data.tar.gz: ec54934506c843f7f937edab6c1117b1615276699fc17adba5fb3514ecc81f07b06b88bc07a664c0b5e794adc9732e5eecd231735cf6b13e1d585eac88b6c020
|
data/lib/fine_print/version.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :fine_print_contract, class: FinePrint::Contract do
|
3
|
+
name { Faker::Lorem.words.join('_') }
|
4
|
+
title { Faker::Lorem.words.join(' ').capitalize }
|
5
|
+
content { Faker::Lorem.paragraphs.join("\n") }
|
6
|
+
|
7
|
+
trait :published do
|
8
|
+
transient do
|
9
|
+
user_factory { :user }
|
10
|
+
signatures_count { 0 }
|
11
|
+
end
|
12
|
+
|
13
|
+
after(:build) do |contract, evaluator|
|
14
|
+
contract.version = (contract.same_name.published
|
15
|
+
.first.try(:version) || 0) + 1
|
16
|
+
|
17
|
+
evaluator.signatures_count.times do
|
18
|
+
contract.signatures << FactoryBot.build(
|
19
|
+
:fine_print_signature,
|
20
|
+
user_factory: evaluator.user_factory
|
21
|
+
)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
factory :fine_print_signature, class: FinePrint::Signature do
|
3
|
+
association :contract, factory: [:fine_print_contract, :published]
|
4
|
+
|
5
|
+
trait :implicit do
|
6
|
+
is_implicit { FinePrint::SIGNATURE_IS_IMPLICIT }
|
7
|
+
end
|
8
|
+
|
9
|
+
transient do
|
10
|
+
user_factory { :user }
|
11
|
+
end
|
12
|
+
|
13
|
+
after(:build) do |signature, evaluator|
|
14
|
+
signature.user ||= FactoryBot.build(evaluator.user_factory)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fine_print
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.0.
|
4
|
+
version: 6.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
@@ -177,6 +177,8 @@ files:
|
|
177
177
|
- lib/fine_print/engine.rb
|
178
178
|
- lib/fine_print/version.rb
|
179
179
|
- lib/tasks/fine_print_tasks.rake
|
180
|
+
- spec/factories/fine_print/contract.rb
|
181
|
+
- spec/factories/fine_print/signature.rb
|
180
182
|
homepage: https://github.com/openstax/fine_print
|
181
183
|
licenses:
|
182
184
|
- MIT
|