Skip to content

Instantly share code, notes, and snippets.

View tjtuom's full-sized avatar

Toni Tuominen tjtuom

View GitHub Profile
# mongo_template.rb
# fork of Ben Scofield's Rails MongoMapper Template (http://gist.github.com/181842)
#
# To use:
# rails project_name -m http://gist.github.com/gists/219223.txt
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
context "build" do
should "update collection without save" do
project = Project.create
project.statuses.build(:name => 'Foo')
project.statuses.size.should == 1
end
should "save built document when saving parent" do
project = Project.create
status = project.statuses.build(:name => 'Foo')
module DateHelper
def auction_date(date)
I18n.localize date, :format => :auction
end
end
Then /^(?:|I )should see "([^\"]*)"(?: within "([^\"]*)")?$/ do |text, selector|
with_scope(selector) do
if defined?(Spec::Rails::Matchers)
page.should have_xpath("//*[text()='#{text}']", :visible => true)
else
assert page.has_xpath("//*[text()='#{text}']", :visible => true)
end
end
end
(ns statistics-one.core
(:use [incanter core stats charts]))
(view (histogram (sample-normal 1000)))