Sha256: 57d1f07f40e70dd6844ba1867aa842c956fabff0ad0a93fe66c2cc0d16d4b16b

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

# coding: utf-8

require 'spec_helper'
require 'livefyre'
require 'jwt'

include Livefyre

describe Livefyre::LivefyreUtil do
  it 'should check for valid and invalid urls' do
    expect(LivefyreUtil::uri?('test.com')).to eq(false)
  
    expect(LivefyreUtil::uri?('http://localhost:8000')).to eq(true)
    expect(LivefyreUtil::uri?('http://清华大学.cn')).to eq(true)
    expect(LivefyreUtil::uri?('http://www.mysite.com/myresumé.html')).to eq(true)
    expect(LivefyreUtil::uri?('https://test.com/')).to eq(true)
    expect(LivefyreUtil::uri?('ftp://test.com/')).to eq(true)
    expect(LivefyreUtil::uri?("https://test.com/path/test.-_~!$&'()*+,;=:@/dash")).to eq(true)
  end

  it 'should get network from all core objects' do
    network = Livefyre.get_network(NETWORK_NAME, NETWORK_KEY)
    site = network.get_site(SITE_ID, SITE_KEY)
    collection = site.build_comments_collection(TITLE, ARTICLE_ID, URL)

    expect(LivefyreUtil::get_network_from_core(network)).to eq(network)
    expect(LivefyreUtil::get_network_from_core(site)).to eq(network)
    expect(LivefyreUtil::get_network_from_core(collection)).to eq(network)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
livefyre-2.0.2 spec/livefyre/utils/utils_spec.rb
livefyre-2.0.1 spec/livefyre/utils/utils_spec.rb
livefyre-2.0.0 spec/livefyre/utils/utils_spec.rb