Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo < ActiveRecord::Base
- attr_accessor(:name, :color)
- before_validation(:method1, :method1)
- private
- def method1
- @name = "widget"
- end
- def method2
- @color = "red"
- end
- end
- it "should have a name and color" do
- @foo = Foo.new
- @foo.save!
- @foo.name.should_not be_nil
- @foo.color.should_not be_nil
- end
Add Comment
Please, Sign In to add comment