Created
April 9, 2012 12:17
-
-
Save daveworth/2343099 to your computer and use it in GitHub Desktop.
Railsy Objects with failing specs
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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