Sha256: 972da0f7e3ba25314bfbe7cd1605af266ce60831235d9b018edf5fa3a294a548

Contents?: true

Size: 1.58 KB

Versions: 14

Compression:

Stored size: 1.58 KB

Contents

require 'helper'

describe Twitter::SavedSearch do

  describe '#==' do
    it 'returns true when objects IDs are the same' do
      saved_search = Twitter::SavedSearch.new(:id => 1, :name => 'foo')
      other = Twitter::SavedSearch.new(:id => 1, :name => 'bar')
      expect(saved_search == other).to be true
    end
    it 'returns false when objects IDs are different' do
      saved_search = Twitter::SavedSearch.new(:id => 1)
      other = Twitter::SavedSearch.new(:id => 2)
      expect(saved_search == other).to be false
    end
    it 'returns false when classes are different' do
      saved_search = Twitter::SavedSearch.new(:id => 1)
      other = Twitter::Identity.new(:id => 1)
      expect(saved_search == other).to be false
    end
  end

  describe '#created_at' do
    it 'returns a Time when created_at is set' do
      saved_search = Twitter::SavedSearch.new(:id => 16_129_012, :created_at => 'Mon Jul 16 12:59:01 +0000 2007')
      expect(saved_search.created_at).to be_a Time
    end
    it 'returns nil when created_at is not set' do
      saved_search = Twitter::SavedSearch.new(:id => 16_129_012)
      expect(saved_search.created_at).to be_nil
    end
  end

  describe '#created?' do
    it 'returns true when created_at is set' do
      saved_search = Twitter::SavedSearch.new(:id => 16_129_012, :created_at => 'Mon Jul 16 12:59:01 +0000 2007')
      expect(saved_search.created?).to be true
    end
    it 'returns false when created_at is not set' do
      saved_search = Twitter::SavedSearch.new(:id => 16_129_012)
      expect(saved_search.created?).to be false
    end
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
twitter-5.11.0 spec/twitter/saved_search_spec.rb
twitter-5.10.0 spec/twitter/saved_search_spec.rb
twitter-5.9.0 spec/twitter/saved_search_spec.rb
twitter-5.8.0 spec/twitter/saved_search_spec.rb
twitter-5.7.1 spec/twitter/saved_search_spec.rb
twitter-5.7.0 spec/twitter/saved_search_spec.rb
twitter-5.6.0 spec/twitter/saved_search_spec.rb
twitter-5.5.1 spec/twitter/saved_search_spec.rb
twitter-5.5.0 spec/twitter/saved_search_spec.rb
twitter-5.4.1 spec/twitter/saved_search_spec.rb
twitter-5.4.0 spec/twitter/saved_search_spec.rb
twitter-5.3.1 spec/twitter/saved_search_spec.rb
twitter-5.3.0 spec/twitter/saved_search_spec.rb
twitter-5.2.0 spec/twitter/saved_search_spec.rb