Sha256: 41b2a4fd3e712ee365d46e13e3061c8d83f64acc47670b6959891e219e9cace0

Contents?: true

Size: 457 Bytes

Versions: 6

Compression:

Stored size: 457 Bytes

Contents

require 'helper'

class TestModelToCleo < Test::Unit::TestCase
  should "convert from model to cleo result" do
    b = Book.new(:name => "Suncrusher", :author => "Tad Williams")
    assert b.respond_to?("as_cleo")
    assert b.respond_to?("to_cleo_result")

    cb = nil
    assert_nothing_raised do
      cb = b.as_cleo
    end

    assert_equal cb.name, b.name.downcase
    assert_equal cb.score, b.cleo_score
    assert_equal 2, cb.terms.count
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acts_as_cleo-2.4.5 test/unit/test_model_to_cleo.rb
acts_as_cleo-2.4.4 test/unit/test_model_to_cleo.rb
acts_as_cleo-2.4.3 test/unit/test_model_to_cleo.rb
acts_as_cleo-2.4.2 test/unit/test_model_to_cleo.rb
acts_as_cleo-2.4.1 test/unit/test_model_to_cleo.rb
acts_as_cleo-2.4.0 test/unit/test_model_to_cleo.rb