Sha256: 685c91d2919f7e6a72e82ef8f5c6a7c964feb469a47620f9665f6f8f4abd5cee

Contents?: true

Size: 531 Bytes

Versions: 2

Compression:

Stored size: 531 Bytes

Contents

require "#{File.dirname(File.expand_path(__FILE__))}/../../helper"

class TestModelToCleo < Test::Unit::TestCase
  should "convert from model to cleo result" do
    b = Book.new(:name => "Suncrusher", :author => Author.create(:name => "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

2 entries across 2 versions & 1 rubygems

Version Path
acts_as_cleo-3.0.2 test/unit/xml/test_model_to_cleo.rb
acts_as_cleo-3.0.1 test/unit/xml/test_model_to_cleo.rb