Sha256: cfc7102f8a2d8b2151d4c95a4c2b894de2dd422e528880d8869c0c9affa1324d

Contents?: true

Size: 562 Bytes

Versions: 18

Compression:

Stored size: 562 Bytes

Contents

require "spec_helper"

describe Brightbox::Api, "#created_on" do
  subject(:api_model) { described_class.new(fog_model) }
  let(:fog_model) do
    double id: nil,
           attributes: attrs,
           created_at: attrs[:created_at]
  end

  context "when initialised with no attributes" do
    let(:attrs) { {} }

    it { expect(api_model.created_on).to be_nil }
  end

  context "when initialised with created_at" do
    let(:attrs) { { created_at: Time.utc(2016, 7, 7, 12, 34, 56) } }

    it { expect(api_model.created_on).to eq("2016-07-07") }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-5.0.0.rc2 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-5.0.0.rc1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-5.0.0.alpha spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.8.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.7.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.6.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.5.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.5.0.rc1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.4.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.3.2 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.3.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.3.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.2.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.2.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.1.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.0.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-4.0.0.rc2 spec/unit/brightbox/api/created_on_spec.rb