diff options
author | Prem Sichanugrist <s@sikachu.com> | 2012-08-24 17:02:27 -0400 |
---|---|---|
committer | Prem Sichanugrist <s@sikachu.com> | 2012-08-24 17:05:14 -0400 |
commit | 1807384c96c553af780e98d25ab4750389233f77 (patch) | |
tree | 2dedca55093b5d975903c09ff8738f1a0bd1be46 /railties/test | |
parent | 19a3eda011bbfae7b7416cfd9b1d5aff6fbffc97 (diff) | |
download | rails-1807384c96c553af780e98d25ab4750389233f77.tar.gz rails-1807384c96c553af780e98d25ab4750389233f77.tar.bz2 rails-1807384c96c553af780e98d25ab4750389233f77.zip |
Raise more helpful error message on missing gem
Tell people to install `activerecord-session_store` gem when it's not
installed instead ofraising `NameError` on missing
`ActionDispatch::Session::ActiveRecordStore`.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index ebdbbaee8b..039b08c723 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -630,5 +630,24 @@ module ApplicationTests ActiveRecord::Base assert defined?(FooObserver) end + + test "config.session_store with :active_record_store with activerecord-session_store gem" do + begin + make_basic_app do |app| + ActionDispatch::Session::ActiveRecordStore = Class.new(ActionDispatch::Session::CookieStore) + app.config.session_store :active_record_store + end + ensure + ActionDispatch::Session.send :remove_const, :ActiveRecordStore + end + end + + test "config.session_store with :active_record_store without activerecord-session_store gem" do + assert_raise RuntimeError, /activerecord-session_store/ do + make_basic_app do |app| + app.config.session_store :active_record_store + end + end + end end end |