Guest User

Untitled

a guest
Jun 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. class Foo < ActiveRecord::Base
  2. attr_accessor(:name, :color)
  3. before_validation(:method1, :method1)
  4.  
  5. private
  6.  
  7. def method1
  8. @name = "widget"
  9. end
  10.  
  11. def method2
  12. @color = "red"
  13. end
  14. end
  15.  
  16.  
  17. it "should have a name and color" do
  18. @foo = Foo.new
  19. @foo.save!
  20. @foo.name.should_not be_nil
  21. @foo.color.should_not be_nil
  22. end
Add Comment
Please, Sign In to add comment