Skip to content
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

Add an integration test to exercise the gem in a real application #44

Merged
merged 5 commits into from
Dec 5, 2021

Conversation

rmacklin
Copy link
Contributor

@rmacklin rmacklin commented Dec 4, 2021

Extracted from #20

As alluded to in #15 (comment), I also thought it would be valuable to add an integration test to ensure everything works as expected within an actual rails application. So, I added a basic integration test in 6ad6b24. (The other commits 88a684d~...de2bf34 are just setup for the integration test which I split out since their large diffs distract from the real "meat" of this PR.)

As noted in #20 (comment), this integration test appropriately failed with the change from 66ce0f8, so it can prevent regressions like #41. (Previously, the test suite wasn't exercising that initializer in the railtie.)

This will be used for integration testing with a real application
This was created by running
```
rails plugin new propshaft --skip-active-record --skip-active-storage --skip-action-mailer --skip-action-cable
```
and importing its generated `test/dummy` folder, and then making a
couple of manual updates:

- [Avoid unnecessary framework `require`s][0]
- [Remove unnecessary files from test app][1]

[0]: rails@5ca90e0
[1]: rails@a1280df
Without the changes from 0fd7814,
the second test fails with:
`ActionView::Template::Error expected but nothing was raised.`
because the gem would simply generate broken tags like
`<link rel="stylesheet" href="" />` and `<script src=""></script>`
rather than raising an exception to loudly inform the developer that the
given asset can't be resolved.
@rmacklin rmacklin changed the title Add integration test Add an integration test Dec 4, 2021
@rmacklin rmacklin changed the title Add an integration test Add an integration test to exercise the gem in a real application Dec 4, 2021
@dhh dhh merged commit 425d9f4 into rails:main Dec 5, 2021
@rmacklin rmacklin deleted the add-integration-test branch December 6, 2021 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants