spec/arachni/session_spec.rb in arachni-1.3.2 vs spec/arachni/session_spec.rb in arachni-1.4

- old
+ new

@@ -220,10 +220,27 @@ expect { subject.logged_in? }.to raise_error described_class::Error::NoLoginCheck end end context 'when a login check is available' do + it 'takes into account #check_options' do + subject.check_options = { + cookies: { + 'custom-cookie' => 'value' + } + } + + Arachni::Options.session.check_url = @url + + expect(subject.http).to receive(:request).with( + Arachni::Options.session.check_url, + hash_including( subject.check_options ) + ) + + configured.logged_in? + end + context 'and a valid session is available' do it 'returns true' do configured.login expect(configured).to be_logged_in end @@ -363,18 +380,18 @@ inputs: :token ).coverage_id).to eq(@id) end end context 'when passed an :action' do - context Regexp do + context 'Regexp' do it 'should use it to match against form actions' do expect(subject.find_login_form( url: @url + '/multiple', action: /login/ ).coverage_id).to eq(@id) end end - context String do + context 'String' do it 'should use it to match against form actions' do expect(subject.find_login_form( url: @url + '/multiple', action: "#{@url}/login" ).coverage_id).to eq(@id)