select-your-own-seat

Expand History Expand History
Collapse History Collapse History

Add System Test for viewing a Seat’s details

This commit introduces factory_bot and configures MiniTest to use it instead of loading our application’s fixture files.

The first test drives the browser by visiting the Benedum Center’s Orchestra floor, then clicking on seat AA-101.

The click_on_seat help is necessary due to Capybara’s inability to treat <a> elements nested within <svg> elements as if they were normal <a> elements. Capybara’s selector strategies include a matcher that finds <a> elements based on their title attribute text, or their aria-label attribute text. However, when matching elements exist within an <svg>, they are not found.

To counteract this limitation, the click_on_seat uses an aria-label attribute CSS selector to determine which element to click.

Running the tests

To simplify executing the entire test suite, this commit declares the default Rake task to execute both rails test and rails test:system.

This diff intentionally commits a failing test suite to the project’s revisions history. It represents the “Red” phase of a “Red, Green, Refactor” cycle, and will be resolved in future commits.