Sha256: b3cf4adc5fb72dfbab5d1f38dfc6ff6aad461ccd5ce5bdbf95c4ae66d67da95d

Contents?: true

Size: 428 Bytes

Versions: 12

Compression:

Stored size: 428 Bytes

Contents

require_relative 'test_helper'

class SimilarAttributeFinderTest < Minitest::Test
  def setup
    @error = assert_raises(ActiveRecord::UnknownAttributeError) do
      User.new(flrst_name: "wrong flrst name")
    end
  end

  def test_similar_words
    assert_suggestion @error.finder.similar_words, "first_name"
  end

  def test_did_you_mean?
    assert_match "Did you mean? first_name: string", @error.did_you_mean?
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
did_you_mean-0.9.10-java test/similar_attribute_finder_test.rb
did_you_mean-0.9.10 test/similar_attribute_finder_test.rb
did_you_mean-0.9.9-java test/similar_attribute_finder_test.rb
did_you_mean-0.9.9 test/similar_attribute_finder_test.rb
did_you_mean-0.9.8 test/similar_attribute_finder_test.rb
did_you_mean-0.9.7 test/similar_attribute_finder_test.rb
did_you_mean-0.9.6-java test/similar_attribute_finder_test.rb
did_you_mean-0.9.6 test/similar_attribute_finder_test.rb
did_you_mean-0.9.5 test/similar_attribute_finder_test.rb
did_you_mean-0.9.4 test/similar_attribute_finder_test.rb
did_you_mean-0.9.2 test/similar_attribute_finder_test.rb
did_you_mean-0.9.0 test/similar_attribute_finder_test.rb