[Meta] Test and fix the Admin Dashboard
Last year we encountered a number of bugs related to the admin dashboard. These were due to changes in our data model not reflected in Administrate as well as some of our more complex relations. This year, we're going to use TDD to ensure that the admin dashboard works for all of our data!
This will include the following:
- For each resource, an automated feature spec for testing the ability to index, show, create, update, and destroy a record
- Scoping of the Users data to the college being viewed (#886 (closed))
- If possible, fixing the search and sort for some of our tables (later)
If you want to see some of the work done on this last year for reference, please check the following merge requests:
Issue Template
Title: [Admin Dashboard] Test and fix [RESOURCE] [ACTION]
Description:
Things to do:
-
Write feature spec to visit the admin dashboard and navigate to the [ACTION] page for [RESOURCE]. If you don't know the exact assertion for success (i.e. because it's broken) just make up the exact content to expect until you've got it working. -
If this test doesn't pass, make it pass!
The specs should live in the folder spec/features/admin
and should be grouped by resource (e.g. spec/features/admin/draws/index_spec.rb
). Broadly speaking, you'll need to do the following:
- Create any test data necessary (including an admin user account to sign in as)
- Navigate to the relevant page (from the application root, via the
Admin Dashboard
link) - If create / update / destroy, perform the associated action
- Assert that the appropriate content is on the page or that the appropriate flash displays
Some of the errors may require you to dig into the administrate gem and/or think carefully about the record you're dealing with and its associations.