Sha256: c62bc2607c50c02903406ef8ef53d0f319a7fdc9718714c186a5625fb0c62ad7

Contents?: true

Size: 721 Bytes

Versions: 21

Compression:

Stored size: 721 Bytes

Contents

require 'helper'

#Literally checking that the acts_as_cleo tag takes args and sets them as expected
class TestActsAsMethods < Test::Unit::TestCase

  should "respond to and return as_cleo" do
    book = Book.new(:name => 'Wedge\'s Life', :author => "Luke Skywalker")
    assert_equal %w{name author}, book.cleo_config[:terms]
    assert_equal "name", book.cleo_config[:name]
    assert_equal "Book", book.cleo_config[:type]
  end

  should "exclude terms by default" do
    movie = Movie.create(:name => "A New Hope", :description => "The Best")
    assert_equal %w{name description}, movie.cleo_config[:terms]
    assert_equal "id", movie.cleo_config[:score]
    assert_equal "name", movie.cleo_config[:name]
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
acts_as_cleo-3.0.0 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.5 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.4 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.3 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.2 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.1 test/unit/test_acts_methods.rb
acts_as_cleo-2.4.0 test/unit/test_acts_methods.rb
acts_as_cleo-2.3.0 test/unit/test_acts_methods.rb
acts_as_cleo-2.2.1 test/unit/test_acts_methods.rb
acts_as_cleo-2.2.0 test/unit/test_acts_methods.rb
acts_as_cleo-2.1.2 test/unit/test_acts_methods.rb
acts_as_cleo-2.1.1 test/unit/test_acts_methods.rb
acts_as_cleo-2.1.0 test/unit/test_acts_methods.rb
acts_as_cleo-2.0.1 test/unit/test_acts_methods.rb
acts_as_cleo-2.0.0 test/unit/test_acts_methods.rb
acts_as_cleo-1.2.0 test/unit/test_acts_methods.rb
acts_as_cleo-1.1.0 test/unit/test_acts_methods.rb
acts_as_cleo-1.0.0 test/unit/test_acts_methods.rb
acts_as_cleo-0.0.4 test/unit/test_acts_methods.rb
acts_as_cleo-0.0.3 test/unit/test_acts_methods.rb