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