Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of git@github.com:nakajima/acts_as_fu

  • Loading branch information...
commit c19bfbbef1e6ef220221e87ad13f53dd0a44ac2b 2 parents 2509e0b + a61f4b6
Pat Nakajima authored November 12, 2008

Showing 1 changed file with 32 additions and 27 deletions. Show diff stats Hide diff stats

  1. 59  README.textile
59  README.textile
Source Rendered
@@ -18,35 +18,40 @@ too, I'll leave you to figure it out though)
18 18
 
19 19
 Then in your specs:
20 20
 
21  
-  describe "acts_as_gilmore_girls" do
22  
-    before(:each) do
23  
-      build_model :nerds do
24  
-        text :omg_omg_bio
25  
-        string :name
26  
-        string :favorite_scene
27  
-        def awesome?(show_name)
28  
-          show_name == "Gilmore Girls"
29  
-        end
30  
-      end
31  
-    end
32  
-    
33  
-    it "should require favorite scene" do
34  
-      nerd = Nerd.new :favorite_scene => nil
35  
-      nerd.should_not be_valid
36  
-      nerd.errors.on(:favorite_scene).should_not be_nil
37  
-    end
38  
-    
39  
-    it "should think gilmore girls is awesome"
40  
-      nerd = Nerd.new
41  
-      nerd.awesome?("Gilmore Girls").should be_true
42  
-    end
43  
-    
44  
-    it "has other stuff" do
45  
-      # ETC!
  21
+<pre>
  22
+describe "acts_as_gilmore_girls" do
  23
+  before(:each) do
  24
+    build_model :nerds do
  25
+      text :omg_omg_bio
  26
+      string :name
  27
+      string :favorite_scene
  28
+      
  29
+      validates_presence_of :favorite_scene
  30
+      
  31
+      def awesome?(show_name)
  32
+        show_name == "Gilmore Girls"
  33
+      end      
46 34
     end
47 35
   end
  36
+
  37
+  it "should require favorite scene" do
  38
+    nerd = Nerd.new :favorite_scene => nil
  39
+    nerd.should_not be_valid
  40
+    nerd.errors.on(:favorite_scene).should_not be_nil
  41
+  end
  42
+
  43
+  it "should think gilmore girls is awesome"
  44
+    nerd = Nerd.new
  45
+    nerd.awesome?("Gilmore Girls").should be_true
  46
+  end
  47
+
  48
+  it "has other stuff" do
  49
+    # ETC!
  50
+  end
  51
+end
  52
+</pre>
48 53
   
49  
-The @build_model@ method allows you to build an ActiveRecord on
  54
+The @build_model@ method allows you to build an ActiveRecord model on
50 55
 the fly. It takes a block where you can specify columns and methods.
51 56
 
52 57
 h4. Single Table Inheritance
@@ -89,4 +94,4 @@ NOTE
89 94
 Despite the above example, watching Gilmore Girls doesn't make you
90 95
 a nerd. Probably.
91 96
 
92  
-(c) Copyright 2008 Pat Nakajima. All Rights Reserved. 
  97
+(c) Copyright 2008 Pat Nakajima. All Rights Reserved.

0 notes on commit c19bfbb

Please sign in to comment.
Something went wrong with that request. Please try again.