title: Duplicate key value violates unique constraint during rspec
body: <p>How to avoid <code>Duplicate key value violates unique constraint</code></p>
  
  <p>i assume that <code>id:1</code> already in use, but i need to strongly setup <code>id</code>,</p>
  
  <p>because i have method in <code>category</code> model</p>
  
  <pre><code>def iconic
    case self.id
        when 1
         smth
       ....
    end  
   end
  </code></pre>
  
  <p>my factory </p>
  
  <pre><code>FactoryGirl.define do
    factory :category do
      sequence(:title) { |n| Faker::Hipster.word+"#{n}" }
      position 1
      text Faker::Lorem.sentence
      image File.open(Rails.root.join('test', 'assets', 'images', 'banners', (1..6).to_a.sample.to_s+'.png'))
  
    end
  end
  
  Failure/Error: c1 = create(:category, id: 1)
  
   ActiveRecord::RecordNotUnique:
     PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "categories_pkey"
     DETAIL:  Key (id)=(1) already exists.
  </code></pre>