-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate model spec in general test file
Our validations are now largely defined by the schemas and are being applied to the models without the need to be manually defined and configured. This validation in tested by our feature tests. It seems unnecessary to test this validation twice.
- Loading branch information
Showing
32 changed files
with
50 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require "spec_helper" | ||
require "models/valid_against_schema" | ||
|
||
EXCEPTIONS_TO_GENERAL_TESTING = %w[ | ||
ai_assurance_portfolio_technique | ||
].freeze | ||
|
||
Dir["lib/documents/schemas/*.json"].each do |file| | ||
schema = JSON.parse(File.read(file)) | ||
format = schema["filter"]["format"] | ||
|
||
next if EXCEPTIONS_TO_GENERAL_TESTING.include?(format) | ||
|
||
RSpec.describe format.classify.constantize do | ||
let(:payload) { FactoryBot.create(format.to_sym) } | ||
include_examples "it saves payloads that are valid against the 'specialist_document' schema" | ||
|
||
it "is not exportable" do | ||
unless subject.instance_of?(BusinessFinanceSupportScheme) | ||
expect(subject.class).not_to be_exportable | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
spec/models/flood_and_coastal_erosion_risk_management_research_report_spec.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 0 additions & 34 deletions
34
spec/models/life_saving_maritime_appliance_service_station_spec.rb
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.