Skip to content

Instantly share code, notes, and snippets.

@daveworth
Created April 9, 2012 12:17
Show Gist options
  • Select an option

  • Save daveworth/2343099 to your computer and use it in GitHub Desktop.

Select an option

Save daveworth/2343099 to your computer and use it in GitHub Desktop.
Railsy Objects with failing specs
class RailsyObject < ActiveRecord::Base
def compound?
# These properties could be attributes or computed attributes
(self.simple? && self.clean?) || self.complicated?
end
def complicated?
# ... snip ...
end
end
describe RailsyObject do
describe "predicates" do
before do
@railsy_obj = FactoryGirl.create(:railsy_object)
end
describe "#compound?" do
it "should pass for the default object from FactoryGirl" do
@railsy_obj.should be_compound
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment