Developer Setup
PMACS Frontend can be split into two discrete parts from a development perspective:
- The Gem itself
- The Frontend Demo App, embedded in
spec/demo_app
Installing
After cloning the project locally:
- Run
bundle installfrom the Gem root (the root-level folder with a.gitdirectory) - Set up the Demo App:
cd spec/demo_app bundle install bundle exec rails db:setup
Important note
Always
bundle installwith the default "Development mode".
Do not attempt to bundle install --deployment, or bundle install --path=vendor/bundle. It is important that the Demo App's dependencies are simultaneously available to both it and the project root.
Running the Demo App
The Demo App uses the PMACS Frontend gem as is in this project's root, allowing you to preview your changes to the source in realtime.
To serve the Demo App:
cd spec/demo_appbundle exec rails s- Navigate your browser to the resulting URL
Creating a user
Create a user:
- Through the Devise login page in the browser, or
Through the Rails console
FactoryBot.create(:user, email: 'admin@example.com', password: 'password')
Testing the Gem
After following the steps in the README, run bundle exec rspec from the Gem root.