Sha256: 1d5264bb78d2db398a1a3861cb34a6cf066bda1cfaefe800a2c486d130cbaa9d
Contents?: true
Size: 534 Bytes
Versions: 45
Compression:
Stored size: 534 Bytes
Contents
require 'spec_helper' describe 'IpBasedAbilitySpec' do controller do include Hydra::Controller::IpBasedAbility end describe '#ability' do let(:user) { double } let(:ip) { '123.456.789.111' } before do allow(controller).to receive(:current_user).and_return(user) allow_any_instance_of(ActionDispatch::Request).to receive(:remote_ip) { ip } end it 'passes ip to ability' do expect(Ability).to receive(:new).with(user, remote_ip: ip) controller.current_ability end end end
Version data entries
45 entries across 45 versions & 1 rubygems