fine_print 6.0.2 → 6.0.3

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: 72f2646950df4fff3898887813e3b9a4cc55d038fe440379a3662c6e7f513e3f
4
- data.tar.gz: 02ac6dad48bcf15824413c8df3bd1190c7f85f971209e74c1dd13d7ed0de9f05
3
+ metadata.gz: 9da35251ccce46e2160a907da2c391d9fef77c7668291bb8d9506e273b7bc09e
4
+ data.tar.gz: cf8cf946235b91dc0e4c57b45cab31082ff5fc08fa4aa612a59b55e97149bbcc
5
5
  SHA512:
6
- metadata.gz: 776671c49a14cce4eff098d1b3d838154a99ee0b222da871b2409d82b69817a1cd38bb4859ab9f968fbafa875d93e269756cdd6143bc48c07df8b83d3c61a4c9
7
- data.tar.gz: 7ed5cdbf08bd4162553f8da52a6b8e4349ad47a117211732207cf80ce0e024f2cb93f157c33d96f01bc8d0fb7a98ae6a271deb865d894df0df79e722a22f1e47
6
+ metadata.gz: 3083f91474924d3e364788ca0fb1799d240882fd0ac0136dddd8d588aaad7a6680bf3332655c4a426de51c7dc16d76c287f85788755621fa4f1cab00e2ed89fa
7
+ data.tar.gz: ec54934506c843f7f937edab6c1117b1615276699fc17adba5fb3514ecc81f07b06b88bc07a664c0b5e794adc9732e5eecd231735cf6b13e1d585eac88b6c020
@@ -1,3 +1,3 @@
1
1
  module FinePrint
2
- VERSION = '6.0.2'
2
+ VERSION = '6.0.3'
3
3
  end
@@ -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.2
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