Sha256: 2bfcdfcc9c2bc01e409884fa2f17021bac6c37267026df7ddfe53f529b77a11b

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe TimestampableInterface do
  let!(:value) { Time.local 2018 }
  let!(:dummy) { OpenStruct.new created_at: value, updated_at: value }

  subject { TimestampableInterface }

  describe 'fields' do
    let(:result) { field.resolve(dummy, nil, nil) }

    describe '.createdAt' do
      let(:field) { subject.fields['createdAt'] }

      it { expect(result).to          eq dummy[:created_at] }
      it { expect(field.type.to_s).to eq 'DateTime!' }
    end

    describe '.updatedAt' do
      let(:field) { subject.fields['updatedAt'] }

      it { expect(result).to          eq dummy[:updated_at] }
      it { expect(field.type.to_s).to eq 'DateTime!' }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
graph_types-0.2.0 spec/lib/graph_types/interfaces/timestampable_interface_spec.rb