Sha256: db3299e21a1c2651636ca4c75676fb9a9c9445f7a4db55da8f245ec5741fbb9a

Contents?: true

Size: 770 Bytes

Versions: 37

Compression:

Stored size: 770 Bytes

Contents

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

class SourceTest < ModelTestCase
  
  include DataCatalog

  context "Source" do
    before do
      @required = {
        :title => "Treasury 2009 Summary",
        :url   => "http://moneybags.gov/data/2009"
      }
    end
  
    context "correct params" do
      before do
        @source = Source.new(@required)
      end
      
      test "should be valid" do
        assert_equal true, @source.valid?
      end
    end

    [:title, :url].each do |missing|
      context "missing #{missing}" do
        before do
          @source = Source.new(@required.delete_if { |k, v| k == missing })
        end
        
        missing_key(:source, missing)
      end
    end

  end
  
end

Version data entries

37 entries across 37 versions & 1 rubygems

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