Sha256: 184027a3c57993695a6db06c5e51776480b183f0a96ba299c9ea32c8ebb2f7d1
Contents?: true
Size: 698 Bytes
Versions: 3
Compression:
Stored size: 698 Bytes
Contents
require 'spec_helper' RSpec.describe Devise::SessionsController, type: :controller do before { @request.env["devise.mapping"] = Devise.mappings[:user] } describe "logout" do let(:user) { FactoryGirl.create(:user) } describe "when user is remotely authenticated" do before { @request.env[DeviseRemoteUser.env_key] = user.email } it "should redirect to DeviseRemoteUser.logout_url" do expect(get :destroy).to redirect_to(DeviseRemoteUser.logout_url) end end describe "when user is not remotely authenticated" do it "should redirect to the root path (Devise default)" do expect(get :destroy).to redirect_to('/') end end end end
Version data entries
3 entries across 3 versions & 1 rubygems