Sha256: 5067c1e084542f153dc330aa03ba388431678e98740dd7107ceacce38dd44980

Contents?: true

Size: 892 Bytes

Versions: 12

Compression:

Stored size: 892 Bytes

Contents

require "spec_helper"

describe SocialAvatarProxy::TwitterAvatar do
  subject do
    SocialAvatarProxy::TwitterAvatar.new(id)
  end

  context "with a valid user ID" do
    let(:id) { "2202971" }

    describe "#remote_url" do
      it "should return a valid URL" do
        result = URI(subject.remote_url)
        expect(result.host).to eq("api.twitter.com")
      end
    end
  end

  context "with a valid user name" do
    let(:id) { "RyanTownsend" }
  
    describe "#remote_url" do
      it "should return a valid URL" do
        result = URI(subject.remote_url)
        expect(result.host).to eq("api.twitter.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/twitter_avatar_spec.rb
social-avatar-proxy-2.0.0 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-1.2.0 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-1.1.0 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-1.0.1 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-1.0.0 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.9 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.8 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.7 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.6 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.5 spec/social_avatar_proxy/twitter_avatar_spec.rb
social-avatar-proxy-0.0.4 spec/social_avatar_proxy/twitter_avatar_spec.rb