Sha256: 03d0fb6cf6e88e27449a432aafb4b25a5c7f7fed48ab428b5f432f370dd225d3

Contents?: true

Size: 908 Bytes

Versions: 12

Compression:

Stored size: 908 Bytes

Contents

require "spec_helper"

describe SocialAvatarProxy::FacebookAvatar do
  subject do
    SocialAvatarProxy::FacebookAvatar.new(id)
  end
  
  context "with a valid user ID" do
    let(:id) { "61413673" }
  
    describe "#remote_url" do
      it "should return a valid URL" do
        result = URI(subject.remote_url)
        expect(result.host).to eq("graph.facebook.com")
      end
    end
  end
  
  context "with a valid user name" do
    let(:id) { "ryandtownsend" }
  
    describe "#remote_url" do
      it "should return a valid URL" do
        result = URI(subject.remote_url)
        expect(result.host).to eq("graph.facebook.com")
      end
    end
  end
    
  context "with an invalid identifier" do
    let(:id) { "$omeInvalidN@me" }
  
    describe "#remote_url" do
      it "should raise an error" do
        expect { subject.remote_url }.to raise_error(RuntimeError)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
social-avatar-proxy-2.0.1 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-2.0.0 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-1.2.0 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-1.1.0 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-1.0.1 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-1.0.0 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.9 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.8 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.7 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.6 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.5 spec/social_avatar_proxy/facebook_avatar_spec.rb
social-avatar-proxy-0.0.4 spec/social_avatar_proxy/facebook_avatar_spec.rb