Sha256: 6f65d6402ae5efbeeaf8ea780115eedcb45804cb1f09db81854c378863f67af7
Contents?: true
Size: 670 Bytes
Versions: 6
Compression:
Stored size: 670 Bytes
Contents
require 'spec_helper' describe SessionsController do let(:session_class) { ::ActionDispatch::Session::SequelStore.session_class } def login post '/session', :status => 'logged_in' end describe '#create' do it 'creates a new session' do expect do login end.to change { session_class.count }.from(0).to(1) expect(session[:status]).to eq 'logged_in' end end describe '#destroy' do before { login } it 'reset session' do old_session_id = cookies['_session_id'] delete '/session' expect(old_session_id).not_to eq cookies['_session_id'] expect(session[:status]).to be_nil end end end
Version data entries
6 entries across 6 versions & 1 rubygems