Sha256: 5725442c35c6642b322e69b4c8e9c2db134aa7636bcc84ea6dd429ec870fb9ec

Contents?: true

Size: 522 Bytes

Versions: 2

Compression:

Stored size: 522 Bytes

Contents

require 'spec_helper'

describe "Rad Mongoid basics" do
  with_mongo_model
  after(:all){remove_constants :Post}

  it "to_rson" do
    class Post
      inherit Mongo::Model

      attr_accessor :text
      available_as_markup :text

      validates_presence_of :text
    end

    post = Post.new
    post.valid?.should be_false
    post.errors[:original_text].should be_present

    post = Post.new
    post.original_text = "<h1>Hello</h1>"
    post.text.should  == "<h1>Hello</h1>"
    post.save.should be_true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rad_kit-0.0.10 spec/mongodb_model/text_processor_spec.rb
rad_kit-0.0.9 spec/mongodb_model/text_processor_spec.rb