플러그인 스펙 실행 시 오류 발생

최신 버전에서 플러그인 스펙을 실행하려고 할 때 두 개의 개발 인스턴스에서 이 문제가 발생합니다.

(테스트 환경에서는 데이터베이스가 완전히 마이그레이션되었습니다):

예: bin/rake plugin:spec\[discourse-locations]

An error occurred while loading rails_helper.
Failure/Error: default_scope { where(deleted_at: nil) }

ActiveRecord::StatementInvalid:
  PG::UndefinedTable: ERROR:  relation "chat_channels" does not exist
  LINE 9:  WHERE a.attrelid = '"chat_channels"'::regclass

< SNIP >

# --- Caused by: ---
# PG::UndefinedTable:
#   ERROR:  relation "chat_channels" does not exist
#   LINE 9:  WHERE a.attrelid = '"chat_channels"'::regclass

테스트 데이터베이스를 확인해 보니 채팅 마이그레이션이 실행되지 않은 것으로 보입니다.

> psql discourse_test 

# \d

아 …!

이 DB 마이그레이션에서 플러그인을 포함하기 위한 첫 번째 환경 변수를 추가하는 것을 잊었습니다 (채팅은 여전히 플러그인이므로):

LOAD_PLUGINS=1 RAILS_ENV=test rake db:migrate