Sha256: 73348c4a327316f1157d1db5f3097d4ad2f01376899fa99fe57dd0e303cd0f6e

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

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

3 entries across 3 versions & 1 rubygems

Version Path
sinatra_resource-0.4.24 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.23 examples/datacatalog/test/models/note_test.rb
sinatra_resource-0.4.22 examples/datacatalog/test/models/note_test.rb