Skip to content

Instantly share code, notes, and snippets.

@nmerouze
Created January 12, 2010 21:36
Show Gist options
  • Save nmerouze/275636 to your computer and use it in GitHub Desktop.
Save nmerouze/275636 to your computer and use it in GitHub Desktop.
Post.blueprint do
title "I like MongoDB!"
body "I have a ton of reasons for that."
end
class Post
include MongoMapper::Document
key :title, String
key :body, String
end
class Post
# ...
validates_presence_of :title
end
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Post do
before(:all) do
@post = Post.make
end
it "should have a title" do
@post.title.should == "I like MongoDB!"
end
end
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Post do
it { should have_keys(:title, :body, String) }
it { should validate_presence_of(:title) }
# ...
end
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
require 'spec/autorun'
require 'spec/rails'
require 'spec/blueprints'
Spec::Runner.configure do |config|
end
config.gem "machinist_mongo", :lib => "machinist/mongo_mapper"
config.gem "remarkable_rails", :lib => "remarkable_rails"
config.gem "remarkable_mongo", :lib => "remarkable/mongo_mapper"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment