-
Notifications
You must be signed in to change notification settings - Fork 20
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
Remove pfg scaffolding #4650
base: main
Are you sure you want to change the base?
Remove pfg scaffolding #4650
Conversation
…ntItemFactory - this helps make sure that it's always a GdsApi::Response that's presented to the factory in tests.
- We now no longer want to render anything when a content item doesn't exist, so we leave that to standard behaviour. - Our example now contains an attachment, so we don't need to specifically stub it.
- Our example now contains an attachment and details, so we don't need to stub them here.
- We're now no longer calling the content item with an optional additional hash anywhere (it was for landing page items, which now don't need it).
- Now that the initializer for the base content item doesn't have the optional params, we can simplify all super calls in derived models.
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 think it's a great that the scaffolding is being removed. 🎉
I have a couple of inline comments / suggestions.
before do | ||
stub_const("LandingPage::ADDITIONAL_CONTENT_PATH", "spec/fixtures") | ||
end | ||
subject(:landing_page) { content_item_from_factory(content_item_hash:) } |
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.
Why do the landing page examples need to be called through content_item_from_factory
when the tests for the other document types don't?
They are also pulling examples from content schemas, but are calling described_class.new
for example this is what we added in the mobbing session:
subject(:content_item) { described_class.new(content_store_response) }
@content_store_response = content_store_response | ||
@content_store_hash = override_content_store_hash || content_store_response.to_hash | ||
@content_store_hash = content_store_response.to_hash |
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.
Is content_store_hash
needed now? I'm sure that before the scaffolding was added, we were just using content_store_response
directly.
I think we should go back to that.
What
Remove PfG scaffolding code
Why
PfG is now live, so we don't need the scaffolding that was necessary to test it before go-live. The ability to load content items from the local path has been
Relies on / Cannot be merged before: alphagov/publishing-api#3153