Sha256: ce5c2cbc49c676f4b7aa022a68b88ef285507a383e511d3ff6fd975b3bd71b16

Contents?: true

Size: 807 Bytes

Versions: 18

Compression:

Stored size: 807 Bytes

Contents

# encoding: utf-8
require_relative 'capybara'

module InternetBrowsingBnk
  module SpecHelper
    module Features
      def search_for(options = {})
        url       = options.fetch(:url)
        content   = options.fetch(:content)
        client_ip = options.fetch(:client_ip, nil)
        time      = options.fetch(:time, nil)
        pac_file  = options.fetch(:pac_file, '/file.pac')

        visit(pac_file)
        within('#search') do
          fill_in 'url', :with => url
          fill_in('client_ip', :with => client_ip) if client_ip
          fill_in('time', :with => time) if time
        end
        click_on('Search')
        expect(page).to have_content(content)
      end
    end
  end
end

# encoding: utf-8
RSpec.configure do |c|
  c.include InternetBrowsingBnk::SpecHelper::Features
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
proxy_tester-0.1.10 spec/support/helper_features.rb
proxy_tester-0.1.8 spec/support/helper_features.rb
proxy_tester-0.1.6 spec/support/helper_features.rb
proxy_tester-0.1.5 spec/support/helper_features.rb
proxy_tester-0.1.4 spec/support/helper_features.rb
proxy_tester-0.1.3 spec/support/helper_features.rb
proxy_tester-0.1.2 spec/support/helper_features.rb
proxy_tester-0.1.1 spec/support/helper_features.rb
proxy_tester-0.1.0 spec/support/helper_features.rb
proxy_tester-0.0.9 spec/support/helper_features.rb
proxy_tester-0.0.8 spec/support/helper_features.rb
proxy_tester-0.0.7 spec/support/helper_features.rb
proxy_tester-0.0.6 spec/support/helper_features.rb
proxy_tester-0.0.5 spec/support/helper_features.rb
proxy_tester-0.0.4 spec/support/helper_features.rb
proxy_tester-0.0.3 spec/support/helper_features.rb
proxy_tester-0.0.2 spec/support/helper_features.rb
proxy_tester-0.0.1 spec/support/helper_features.rb