Sha256: 8944bbb25412a6649a55e9c71611a91b3cc65d160c99d17934895a7d61e77408

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Article, '#findy' do
  context 'when a hash is given' do
    context 'when 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 'when 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-1.0.0 spec/lib/idy/extension/findy_spec.rb