What are the guidelines or rules for what kind of Ruby and/or Rails code is permitted/appropriate inside a “scenario”, and what kind of code is not appropriate?
Background:
I am just starting with cypress-on-rails.
I installed it because I’m refactoring a legacy rails app that rendered most views using erb to use react-on-rails. But now I can’t use the assert_select method to check for the presence of DOM elements, since they are rendered by React.
My question pertains to the use of scenarios. I want to set up scenarios where various types of users are logged in (normally this is done with Devise/OAuth).
For integration tests written in Ruby, I was able to do this easily with methods from https://www.rubydoc.info/gems/devise/Devise/Test/IntegrationHelpers
.
However, when I try to include that file in a scenario, I get a variety of errors.
This leads me to believe that I have a misunderstanding about how to go about setting up state for my tests using Ruby code.
Does anyone have any suggestions?