Welcome to mirror list, hosted at ThFree Co, Russian Federation.

representation_spec.rb « github_import « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58c10c4a7755fa46cb74058c030d4be9ed72a437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::GithubImport::Representation do
  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