Skip to content

Instantly share code, notes, and snippets.

@cyx
Created March 4, 2010 23:46
Show Gist options
  • Save cyx/322272 to your computer and use it in GitHub Desktop.
Save cyx/322272 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe Reply do
it_should_behave_like AnActiveModel
it { should validate_length_of(:body, :within => 1..140) }
end
@chikamichi
Copy link

https://gist.github.com/579839

It should goes straight into your spec_helper.rb (or in another file which you'll require within spec_helper.rb).

If your using 1.9.2, you'll face a bug with super being called on singleton methods. Just wrap all methods with a super call with an eval %( … ) closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment