Skip to content

Instantly share code, notes, and snippets.

@wlangstroth
Created January 13, 2014 16:46
Show Gist options
  • Save wlangstroth/8403562 to your computer and use it in GitHub Desktop.
Save wlangstroth/8403562 to your computer and use it in GitHub Desktop.
require_relative '../test_helper'
class ThingTest < ActiveSupport::TestCase
def test_fixtures
Thing.all.each do |thing|
assert thing.valid?, thing.errors.inspect
end
end
def test_validations
thing = Thing.new
assert thing.invalid?
assert_has_errors_on thing,
:name => ["can't be blank"],
:short_name => ["can't be blank"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment