Skip to content

Instantly share code, notes, and snippets.

@esparkman
Last active August 29, 2015 14:13
Show Gist options
  • Save esparkman/fd0964e1cfd68729d83c to your computer and use it in GitHub Desktop.
Save esparkman/fd0964e1cfd68729d83c to your computer and use it in GitHub Desktop.
1) Error:
User#test_0001_should be valid:
ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR: null value in column "email" violates not-null constraint
DETAIL: Failing row contains (980190962, null, null, null, 2015-01-20 03:17:42, 2015-01-20 03:17:42, f, pending_review, f).
: INSERT INTO "users" ("created_at", "updated_at", "id") VALUES ('2015-01-20 03:17:42', '2015-01-20 03:17:42', 980190962)
1 require 'test_helper'
2
3 describe User do
4 before do
5 @user = User.new(email: "[email protected]", password: "passw0rd")
6 end
7
8 it "should be valid" do
9 assert @user.valid?
10 end
11 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment