Skip to content

Commit 5956f5f

Browse files
committed
Change rails server with test environment
1 parent 20ab815 commit 5956f5f

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

README.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,6 @@ If you are not using `factory_bot` look at `e2e/cypress/app_commands/factory_bot
117117

118118
Now you can create scenarios and commands that are plain Ruby files that get loaded through middleware, the ruby sky is your limit.
119119

120-
### Update your database.yml
121-
122-
When writing and running tests on your local computer, it's recommended to start your server in development mode so that changes you
123-
make are picked up without having to restart your local server.
124-
125-
It's recommended you update your `database.yml` to check if the `CYPRESS` environment variable is set and switch it to the test database
126-
otherwise, cypress will keep clearing your development database.
127-
128-
For example:
129-
```yaml
130-
development:
131-
<<: *default
132-
database: <%= ENV['CYPRESS'] ? 'my_db_test' : 'my_db_development' %>
133-
test:
134-
<<: *default
135-
database: my_db_test
136-
```
137-
138120
### WARNING
139121
*WARNING!!:* cypress-on-rails can execute arbitrary ruby code
140122
Please use with extra caution if starting your local server on 0.0.0.0 or running the gem on a hosted server
@@ -144,8 +126,8 @@ Please use with extra caution if starting your local server on 0.0.0.0 or runnin
144126
Getting started on your local environment
145127

146128
```shell
147-
# start rails
148-
CYPRESS=1 bin/rails server -p 5017
129+
# start rails with test environment
130+
CYPRESS=1 RAILS_ENV=test bin/rails server -p 5017
149131

150132
# in separate window start cypress
151133
yarn cypress open --project ./e2e

0 commit comments

Comments
 (0)