Sha256: 9e73791406b95463c0f8c46f2c3926bdd325e7bbf049de75272d076345705ee9

Contents?: true

Size: 728 Bytes

Versions: 14

Compression:

Stored size: 728 Bytes

Contents

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

class CategoryTest < ModelTestCase
  
  include DataCatalog

  context "Category" do
    before do
      @required = {
        :name => "Science & Technology"
      }
    end
  
    context "correct params" do
      before do
        @category = Category.new(@required)
      end
      
      test "should be valid" do
        assert_equal true, @category.valid?
      end
    end
    
    [:name].each do |missing|
      context "missing #{missing}" do
        before do
          @category = Category.new(@required.delete_if { |k, v| k == missing })
        end
        
        missing_key(:category, missing)
      end
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

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