Sha256: 34ba24b1e9c9c8414e0847ebe88881abddd60a79a2cefc0da93792896a72f5e1
Contents?: true
Size: 881 Bytes
Versions: 39
Compression:
Stored size: 881 Bytes
Contents
require 'spec_helper' module Clearance describe SignInGuard do it 'handles success' do sign_in_guard = SignInGuard.new(double("session")) status = double("status") allow(SuccessStatus).to receive(:new).and_return(status) expect(sign_in_guard.success).to eq(status) end it 'handles failure' do sign_in_guard = SignInGuard.new(double("session")) status = double("status") failure_message = "Failed" allow(FailureStatus).to receive(:new). with(failure_message). and_return(status) expect(sign_in_guard.failure(failure_message)).to eq(status) end it 'can proceed to the next guard' do guards = double("guards", call: true) sign_in_guard = SignInGuard.new(double("session"), guards) sign_in_guard.next_guard expect(guards).to have_received(:call) end end end
Version data entries
39 entries across 39 versions & 1 rubygems