Sha256: e5d811d4e0c07a6a95c0c1e8a43eb5ec89d7d90c5f5b45b67c3d82c50d6e92f0

Contents?: true

Size: 978 Bytes

Versions: 14

Compression:

Stored size: 978 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

14 entries across 14 versions & 1 rubygems

Version Path
sinatra_resource-0.3.5 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.4 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.3 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.2 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.1 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.3.0 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.6 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.5 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.4 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.3 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.2 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.1 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.2.0 examples/datacatalog/test/models/categorization_test.rb
sinatra_resource-0.1.0 examples/datacatalog/test/models/categorization_test.rb