lib/rspec/models/unidom/party/company_spec.rb in unidom-party-1.9.6 vs lib/rspec/models/unidom/party/company_spec.rb in unidom-party-1.9.7
- old
+ new
@@ -14,13 +14,19 @@
model_attributes = {
name: 'Tesla'
}
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
- it_behaves_like 'Unidom::Party::Concerns::AsSourceParty', model_attributes
- it_behaves_like 'Unidom::Party::Concerns::AsTargetParty', model_attributes
- it_behaves_like 'validates text', model_attributes, :name, length: 2..described_class.columns_hash['name'].limit
+ target_party = described_class.create! model_attributes
+ source_party = described_class.create! model_attributes
+ linkage_code = 'SELF'
+
+ it_behaves_like 'Unidom::Party::Concerns::AsSourceParty', model_attributes, target_party, linkage_code
+ it_behaves_like 'Unidom::Party::Concerns::AsTargetParty', model_attributes, source_party, linkage_code
+
+ it_behaves_like 'validates text', model_attributes, :name,
+ length: 2..described_class.columns_hash['name'].limit
end
end