Sha256: 2080a2c6121e5117528539c72b799d0aff3a9220ab04de6b819aebc3a071cb36

Contents?: true

Size: 982 Bytes

Versions: 23

Compression:

Stored size: 982 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../helpers/model_test_helper')

class CategorizationTest < ModelTestCase
  
  include DataCatalog
  
  context "Categorization" do
    before do
      @source = create_source
      @category = create_category
      @categorization = create_categorization(
        :source_id   => @source.id,
        :category_id => @category.id
      )
    end
    
    after do
      @source.destroy
      @category.destroy
      @categorization.destroy
    end
    
    test "Categorization#source is correct" do
      assert_equal @source, @categorization.source
    end

    test "Categorization#category is correct" do
      assert_equal @category, @categorization.category
    end
    
    test "Source#categorization is correct" do
      assert_equal [@categorization], @source.categorizations
    end
    
    test "Category#categorization is correct" do
      assert_equal [@categorization], @category.categorizations
    end
  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
sinatra_resource-0.4.1 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.0 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.6 examples/datacatalog/test/models/categorization_test.rb