spec/twitter/user_spec.rb in twitter-5.0.0.rc.1 vs spec/twitter/user_spec.rb in twitter-5.0.0
- old
+ new
@@ -1,25 +1,25 @@
-# -*- coding: UTF-8 -*-
+# coding: utf-8
require 'helper'
describe Twitter::User do
describe "#==" do
it "returns true when objects IDs are the same" do
user = Twitter::User.new(:id => 1, :screen_name => "foo")
other = Twitter::User.new(:id => 1, :screen_name => "bar")
- expect(user == other).to be_true
+ expect(user == other).to be true
end
it "returns false when objects IDs are different" do
user = Twitter::User.new(:id => 1)
other = Twitter::User.new(:id => 2)
- expect(user == other).to be_false
+ expect(user == other).to be false
end
it "returns false when classes are different" do
user = Twitter::User.new(:id => 1)
other = Twitter::Identity.new(:id => 1)
- expect(user == other).to be_false
+ expect(user == other).to be false
end
end
describe "#created_at" do
it "returns a Time when created_at is set" do
@@ -33,33 +33,33 @@
end
describe "#created?" do
it "returns true when created_at is set" do
user = Twitter::User.new(:id => 7505382, :created_at => "Mon Jul 16 12:59:01 +0000 2007")
- expect(user.created?).to be_true
+ expect(user.created?).to be true
end
it "returns false when created_at is not set" do
user = Twitter::User.new(:id => 7505382)
- expect(user.created?).to be_false
+ expect(user.created?).to be false
end
end
describe "#description_uris" do
it "returns an array of Entity::URIs when entities are set" do
urls_array = [
{
:url => "http://example.com/t.co",
:expanded_url => "http://example.com/expanded",
- :display_url => "example.com/expanded",
+ :display_url => "example.com/expanded…",
:indices => [10, 33],
}
]
user = Twitter::User.new(:id => 7505382, :entities => {:description => {:urls => urls_array}})
expect(user.description_uris).to be_an Array
expect(user.description_uris.first).to be_a Twitter::Entity::URI
expect(user.description_uris.first.indices).to eq([10, 33])
- expect(user.description_uris.first.display_uri.to_s).to eq("example.com/expanded")
+ expect(user.description_uris.first.display_uri).to eq("example.com/expanded…")
end
it "is empty when not set" do
user = Twitter::User.new(:id => 7505382, :entities => {:description => {:urls => []}})
expect(user.description_uris).to be_empty
end
@@ -164,15 +164,15 @@
end
describe "#profile_banner_uri?" do
it "returns true when profile_banner_url is set" do
user = Twitter::User.new(:id => 7505382, :profile_banner_url => "https://si0.twimg.com/profile_banners/7505382/1348266581")
- expect(user.profile_banner_uri?).to be_true
+ expect(user.profile_banner_uri?).to be true
end
it "returns false when status is not set" do
user = Twitter::User.new(:id => 7505382)
- expect(user.profile_banner_uri?).to be_false
+ expect(user.profile_banner_uri?).to be false
end
end
describe "#profile_image_uri" do
it "accepts utf8 urls" do
@@ -265,15 +265,15 @@
end
describe "#profile_image_uri?" do
it "returns true when profile_banner_url is set" do
user = Twitter::User.new(:id => 7505382, :profile_image_url_https => "https://si0.twimg.com/profile_banners/7505382/1348266581")
- expect(user.profile_image_uri?).to be_true
+ expect(user.profile_image_uri?).to be true
end
it "returns false when status is not set" do
user = Twitter::User.new(:id => 7505382)
- expect(user.profile_image_uri?).to be_false
+ expect(user.profile_image_uri?).to be false
end
end
describe "#status" do
it "returns a Status when status is set" do
@@ -292,15 +292,15 @@
end
describe "#status?" do
it "returns true when status is set" do
user = Twitter::User.new(:id => 7505382, :status => {:id => 25938088801})
- expect(user.status?).to be_true
+ expect(user.status?).to be true
end
it "returns false when status is not set" do
user = Twitter::User.new(:id => 7505382)
- expect(user.status?).to be_false
+ expect(user.status?).to be false
end
end
describe "#uri" do
it "returns the URI to the user" do
@@ -323,14 +323,14 @@
end
describe "#website?" do
it "returns true when the url is set" do
user = Twitter::User.new(:id => 7505382, :url => "https://github.com/sferik")
- expect(user.website?).to be_true
+ expect(user.website?).to be true
end
it "returns false when the url is not set" do
user = Twitter::User.new(:id => 7505382)
- expect(user.website?).to be_false
+ expect(user.website?).to be false
end
end
end