Skip to content

Instantly share code, notes, and snippets.

describe MyCustomerAdapter do
should_support_adapter_interface :create
should_support_adapter_interface :delete
end
class Item < ActiveRecord::Base
def self.make_three_with_transactions
transaction do
transaction do
Item.create!
Item.create!
Item.create!
end
end
end
Given I'm logged in Joe
And I write the amazing blog post on 03-01-2009:
"""
Do you feel lucky punk? Well, do yah?
"""
When I visit the blog post rss feed
Then I should see the post has the author Joe
And I should see the post was made on 03-01-2008
And I should see the post content is
"""
describe Order do
uses_transaction "should create a new one"
it "should create a new one" do
Order.create! :name => "bar"
end
it "should create a different one one" do
Order.create! :name => "foo"
end
# ar-extensions only affects ActiveRecord so I have
# a rake task which loads ActiveRecord, and then
# ar-extensions, and then runs ActiveRecord's test suite
# to make sure I didn't break anything.
for tag in master v2.3.2.1 v2.2.2 v2.1.2 v1.2.6 ; do
echo
echo
echo
echo "***************************************************"
echo " $tag"
# the current spike
simulated "should raise an error" do
lambda { check "remember_me" }.should raise_error(Webrat::NotFoundError)
end
# our fake tagging, since we own "simualated"
simulated "should raise an error", :rack, :mechanize, :rails do
lambda { check "remember_me" }.should raise_error(Webrat::NotFoundError)
end
webrat "should raise an error", :rails, :rack, :mechanize do
lambda { check "remember_me" }.should raise_error(Webrat::NotFoundError)
end
webrat "should raise an error", :selenium do
pending "currently broken"
lambda { check "remember_me" }.should raise_error(Webrat::NotFoundError)
end
def stub_filters_of_type(type, options)
controller.class.send("#{type}_filters").each do |filter_name|
next if options[:except].respond_to?(:include?) && options[:except].include?(filter_name)
next if options[:except] == filter_name
next if filter_name.is_a?(Proc)
controller.stub!(filter_name).and_return(true)
end
end
def stub_before_filters!(options = {})
$ sudo port install libvorbis
---> Building libvorbis
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/work/libvorbis-1.2.2" && make all " returned error 2
Command output: make[3]: Nothing to be done for `all-am'.
Making all in vq
make[2]: Nothing to be done for `all'.
Making all in lib
Making all in modes
make[3]: Nothing to be done for `all'.
Making all in books
---> Building libtheora
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_multimedia_libtheora/work/libtheora-1.0" && make all " returned error 2
Command output: dec/apiwrapper.c:49: error: '_th' undeclared (first use in this function)
dec/apiwrapper.c: At top level:
dec/apiwrapper.c:59: error: syntax error before '*' token
dec/apiwrapper.c: In function 'theora_control':
dec/apiwrapper.c:61: error: '_th' undeclared (first use in this function)
dec/apiwrapper.c:63: error: '_req' undeclared (first use in this function)
dec/apiwrapper.c:63: error: '_buf' undeclared (first use in this function)
dec/apiwrapper.c:63: error: '_buf_sz' undeclared (first use in this function)