Sha256: 2398b1deae10a5833a84d4155f4754c6f464849c0d829f66910039d47321a8f3

Contents?: true

Size: 2 KB

Versions: 15

Compression:

Stored size: 2 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe ProxyPac::PacResultHtmlStylist do
  context '#initialize' do
    it 'does not require anything' do
      expect {
      ProxyPac::PacResultHtmlStylist.new
      }.not_to raise_error
    end
  end

  context '#style_me' do
    it 'builds html for full string' do
      result = double('PacResult')
      allow(result).to receive(:proxy_port).and_return('8080')
      allow(result).to receive(:proxy).and_return('127.0.0.1')
      allow(result).to receive(:request_type).and_return('PROXY')
      allow(result).to receive(:styled_content=).with("<div class=\"lp_main_container\">\n  <div class=\"lp_element_container\">\n    <div class=\"lp_header\">\n    Request Type\n    </div>\n    <div class=\"lp_request_type\">\n      PROXY\n    </div>\n  </div>\n  <div class=\"lp_element_container\">\n    <div class=\"lp_header\">\n    Proxy\n    </div>\n    <div class=\"lp_proxy\">\n      127.0.0.1\n    </div>\n  </div>\n  <div class=\"lp_element_container\">\n    <div class=\"lp_header\">\n    Proxy Port\n    </div>\n    <div class=\"lp_request_type\">\n      8080\n    </div>\n  </div>\n</div>")


      stylist = ProxyPac::PacResultHtmlStylist.new
      stylist.style_me(result)
    end

    it 'builds html for string without port' do
      result = double('PacResult')
      allow(result).to receive(:proxy_port).and_return(nil)
      allow(result).to receive(:proxy).and_return('127.0.0.1')
      allow(result).to receive(:request_type).and_return('PROXY')
      allow(result).to receive(:styled_content=).with("<div class=\"lp_main_container\">\n  <div class=\"lp_element_container\">\n    <div class=\"lp_header\">\n    Request Type\n    </div>\n    <div class=\"lp_request_type\">\n      PROXY\n    </div>\n  </div>\n  <div class=\"lp_element_container\">\n    <div class=\"lp_header\">\n    Proxy\n    </div>\n    <div class=\"lp_proxy\">\n      127.0.0.1\n    </div>\n  </div>\n</div>")

      stylist = ProxyPac::PacResultHtmlStylist.new
      stylist.style_me(result)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
local_pac-0.10.2 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.10.1 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.10.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.9.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.7.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.6.3 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.6.2 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.6.1 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.5.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.4.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.3.0 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.2.3 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.2.2 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.2.1 spec/proxy_pac/pac_result_html_stylist_spec.rb
local_pac-0.2.0 spec/proxy_pac/pac_result_html_stylist_spec.rb