Skip to content

Development Environment Tips & Tricks

Henne Vogelsang edited this page Sep 5, 2018 · 1 revision

Email Notifications

We use letter_opener in development environment. You can check out your mails by visiting localhost:3000/letter_opener.

Using iChain in test mode

devise_ichain_authenticatable comes with a test mode, which can be useful in development phase in which an iChain proxy is not usually configured or even available. You can enable ichain authentication by setting OSEM_ICHAIN_ENABLED equal to true in your .env.development file. You would also need to set following options in devise.rb:

# Activate the test mode
config.ichain_test_mode = true

# 'testuser' user will be permanently signed in.
config.ichain_force_test_username = "testuser"

# set email of 'testuser'
config.ichain_force_test_attributes = {:email => "[email protected]"}

Using OpenID in developement

OSEM supports OpenID logins via OmniAuth and related provider specific gems. OmniAuth provides the ablity to define per-provider mock accounts for testing. The supported providers are Facebook, Google, openSUSE and GitHub. If you want to use the OSEM provided mock accounts you need to set the appropriate OSEM_PROVIDER_KEY and OSEM_PROVIDER_SECRET environment variables to a non empty string in the .env file.

e.g.

OSEM_GITHUB_KEY='sample'
OSEM_GITHUB_SECRET='sample'

If you don't already have a .env.development file you can use the dotenv.example as a template.