preventing_fund_to_compute_site_duplications

This is to prevent people assigning same compute site to the same fund more then once.
I have no idea where to find that comment of yours in the github 
(removed?), so let me try to answer with an email and see what happens :).

I used to think, some time ago, that it would in fact be a duplication. 
I no longer do. After a lot of model testing I no longer trust this 
certain uniqueness validator test - I had my problem with this exact 
rspec call before. So I left it here for completeness sake, but I prefer 
to do it in a more explicit way as well.


On 12/09/2014 08:26 PM, Marek Kasztelnik wrote:
> In spec/models/atmosphere/compute_site_fund_spec.rb
> <https://github.com/dice-cyfronet/atmosphere/pull/41#discussion-diff-21554808>:
>
>> +                  scoped_to(:fund_id).
>> +                  with_message(I18n.t('funds.unique_compute_site')) }
>> +
>> +  let!(:compute_site_fund) { create(:compute_site_fund) }
>> +
>> +  it 'is valid' do
>> +    expect(compute_site_fund).to be_valid
>> +  end
>> +
>> +  it 'prevents duplication of compute site assignment to a fund' do
>> +    csf = Atmosphere::ComputeSiteFund.create(
>> +        compute_site: compute_site_fund.compute_site,
>> +        fund: compute_site_fund.fund
>> +    )
>> +    expect(csf).not_to be_valid
>> +    expect(csf.errors.full_messages.first).to include(I18n.t('funds.unique_compute_site'))
>
> Isn't it duplication of previous test?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dice-cyfronet/atmosphere/pull/41/files#r21554808>.
>