debian-mirror-gitlab/spec/lib/gitlab/github_import/representation_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
518 B
Ruby
Raw Normal View History

2019-12-26 22:10:19 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Gitlab::GithubImport::Representation do
2018-03-17 18:26:18 +05:30
describe '.symbolize_hash' do
it 'returns a Hash with the keys as Symbols' do
hash = described_class.symbolize_hash('number' => 10)
expect(hash).to eq({ number: 10 })
end
it 'parses timestamp fields into Time instances' do
hash = described_class.symbolize_hash('created_at' => '2017-01-01 12:00')
expect(hash[:created_at]).to be_an_instance_of(Time)
end
end
end