Sha256: d6bbcf15a7ed1fe1ab206d4e1acabd9b701c7a89ea55ec034602ac75bc42ca9c

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe '#findy' do
  context 'when a hash is given' do
    context 'and record is found' do
      let!(:record) { Article.create id: 1 }
      let!(:hash)   { 'My' }

      it 'finds the record' do
        expect(Article.findy(hash)).to eq record
      end
    end

    context 'and record is not found' do
      let!(:hash) { 'My' }

      it 'returns nil' do
        expect(Article.findy(hash)).to be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
idy-0.1.3 spec/lib/idy/extension/findy_spec.rb