This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module DateHelper | |
def auction_date(date) | |
I18n.localize date, :format => :auction | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns statistics-one.core | |
(:use [incanter core stats charts])) | |
(view (histogram (sample-normal 1000))) |