Sha256: a0efda68ea34e6bb3c43a635d5d5291b3b2876b166695b2313d026d0d9d2c179
Contents?: true
Size: 1.33 KB
Versions: 5
Compression:
Stored size: 1.33 KB
Contents
require 'spec_helper' describe Capgun::Account do describe "#==" do it "should return true when ids and classes are equal" do user = Capgun::Account.new('id' => 1) other = Capgun::Account.new('id' => 1) (user == other).should be_true end it "should return false when classes are not equal" do user = Capgun::Account.new('id' => 1) other = Capgun::Order.new('id' => 1) (user == other).should be_false end it "should return false when ids are not equal" do user = Capgun::Account.new('id' => 1) other = Capgun::Job.new('id' => 2) (user == other).should be_false end end describe "#created_at" do it "should return a Time when created_at is set" do user = Capgun::Account.new('created_at' => "Mon Jul 16 12:59:01 +0000 2007") user.created_at.should be_a Time end it "should return nil when created_at is not set" do user = Capgun::Account.new user.created_at.should be_nil end end describe "#updated_at" do it "should return a Time when updated_at is set" do user = Capgun::Account.new('updated_at' => "Mon Jul 16 12:59:01 +0000 2007") user.updated_at.should be_a Time end it "should return nil when updated_at is not set" do user = Capgun::Account.new user.updated_at.should be_nil end end end
Version data entries
5 entries across 5 versions & 1 rubygems