Sha256: b3a9c11f2c00c3851e1e1c0fde4eabe38b490da1a6214f709abc65c2a4d1906c

Contents?: true

Size: 560 Bytes

Versions: 20

Compression:

Stored size: 560 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

20 entries across 20 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-3.2.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-3.1.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-3.0.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-3.0.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.12.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.11.2 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.11.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.11.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.10.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.9.3 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.9.2 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.9.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.9.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.8.2 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.8.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.8.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.7.1 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.7.0 spec/unit/brightbox/api/created_on_spec.rb
brightbox-cli-2.6.0 spec/unit/brightbox/api/created_on_spec.rb