Add system test for resource download functionality #745
+102
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the goal of this PR and why is this important?
Tests to ensure that facilitators can successfully download assets from both the dashboard and resources index page, verifying the core download workflow works as expected.
How did you approach the change?
Followed previous patterns and created fixtures to simulate adding media that would be downloaded.
Anything else to add?
I created the fixtures folder for this test. I don't know if there are other ways to upload media. For the media I used already existing images from assests file, but I named them differently.
When I use kind: "Scholarship" it gets created in the database and can be found in the console, but it doesn't show up for testing or on the website; even the search function couldn't find it.
In the test I wrote #expect(page.status_code).to eq(200) which is supposed to pass, but it's not because there is an ActiveRecord error when visiting /resource/id/download, so I commented out this line along with two other checks.