-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dry specialist publisher tests #3029
base: main
Are you sure you want to change the base?
Changes from 1 commit
12353cc
284af6a
30e7f2e
d927acf
628b016
0f653f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd move this into its own commit - it'll make the PR easier to review. I had drafted the following comment further up in this commit, because it looked as though you were deleting the schema validation tests without adding a new equivalent. When you move this into its own commit, you can also use that as an opportunity to explain (in the message) why
|
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would actually quite like the validation tests to live here, rather than in the feature specs. |
||
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 was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the behaviour changed or was this fixture data always wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it must have always been wrong, when I ran this through the 'valid_against_schema' shared example it complained about the time element.
I don't think this was caught previously because the drcf finder didn't have it's own model spec file to check it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for animal disease case