PG::UniqueViolation: ERROR: duplicate key value violates unique constraint

Take a look at your test/fixtures/users.yml file and comment out any blank fixtures. See example below:

#one: {}
#two: {}

I too had faced the same problem, drop the database and recreate it.

rake db:drop
rake db:create
rake db:migrate

hope it will work


You are inserting a user without an email and you already have one. If you want to ignore blanks on the duplicate check, change your validator:

class User < ActiveRecord::Base
  validates :email, :uniqueness => {:allow_blank => true}
end