require 'spec_helper' describe ContextController, type: :controller do it 'preloads contexts' do get :index expect(controller.current_context(:locale)).to eq(:en) expect(controller.current_context(:city)).to eq(nil) controller.contexts[:locale].apply(controller, :ru) expect(controller.locale_page_path).to eq('/ru/locale') end end