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.21 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.20 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.19 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.18 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.17 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.16 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.15 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.14 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.13 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.12 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.11 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.10 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.9 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.8 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.7 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.6 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.5 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.4 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.3 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.4.2 examples/datacatalog/test/models/categorization_test.rb