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

time_type_spec.rb « types « graphql « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4196d9d27d465d3205fbea25aa9cdb3df17bcad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'spec_helper'

describe GitlabSchema.types['Time'] do
  let(:iso) { "2018-06-04T15:23:50+02:00" }
  let(:time) { Time.parse(iso) }

  it { expect(described_class.graphql_name).to eq('Time') }

  it 'coerces Time object into ISO 8601' do
    expect(described_class.coerce_isolated_result(time)).to eq(iso)
  end

  it 'coerces an ISO-time into Time object' do
    expect(described_class.coerce_isolated_input(iso)).to eq(time)
  end
end