Sha256: c22e45b03bb613fabda00b605510a123ce3f801a36da065a89a343bab2cf6e7f

Contents?: true

Size: 800 Bytes

Versions: 29

Compression:

Stored size: 800 Bytes

Contents

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

class NoteTest < ModelTestCase
  
  include DataCatalog

  context "Note" do
    before do
      @user = create_user
      @required = {
        :text    => "Example Note",
        :user_id => @user.id
      }
    end
    
    after do
      @user.destroy
    end
  
    context "correct params" do
      before do
        @note = Note.new(@required)
      end
      
      test "should be valid" do
        assert_equal true, @note.valid?
      end
    end

    [:text, :user_id].each do |missing|
      context "missing #{missing}" do
        before do
          @note = Note.new(@required.delete_if { |k, v| k == missing })
        end
        
        missing_key(:note, missing)
      end
    end

  end
  
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
sinatra_resource-0.4.21 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.20 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.19 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.18 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.17 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.16 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.15 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.14 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.13 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.12 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.11 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.10 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.9 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.8 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.7 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.6 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.5 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.4 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.3 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.2 examples/datacatalog/test/models/note_test.rb