Sha256: 95b495fba7053565edb17294e1731bdb8ef98a0c7599c66ea6fc120e9532ef88

Contents?: true

Size: 884 Bytes

Versions: 2

Compression:

Stored size: 884 Bytes

Contents

require 'spec_helper'

describe PictureFrom::Keyword do

  describe '#email?' do

    describe 'when a valid email is passed' do
      subject { described_class.new('karreiro@gmail.com') }

      it 'returns true' do
        expect(subject.type).to eq(:email)
      end
    end

    describe 'when a twitter username is passed' do
      subject { described_class.new('@g_carreiro') }

      it 'returns true' do
        expect(subject.type).to eq(:username)
      end
    end

    describe 'when a facebook username is passed' do
      subject { described_class.new('karreiro') }

      it 'returns true' do
        expect(subject.type).to eq(:username)
      end
    end

    describe 'when an user info is passed' do
      subject { described_class.new('Guilherme Carreiro') }

      it 'returns true' do
        expect(subject.type).to eq(:user_info)
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
picture_from-1.0.1 spec/lib/picture_from/keyword_spec.rb
picture_from-1.0.0 spec/lib/picture_from/keyword_spec.rb