Sha256: 5fdc8e3ff5ca4e85dff8bebca0379d9ec29489a08a7e9242362403e84770231f

Contents?: true

Size: 863 Bytes

Versions: 21

Compression:

Stored size: 863 Bytes

Contents

# coding utf-8

require 'rails_helper'

describe 'Règlement', :type => :model do
  include Fixtures
  
  describe 'validations' do
    
    before(:each) do 
      @reglement = Adherent::Reglement.new(amount:50)
      @reglement.payment_id = 1
      @reglement.adhesion_id = 9
    end
    
    it 'est valide' do
      expect(@reglement).to be_valid
    end
    
    it 'mais pas sans payment_id' do
      @reglement.payment_id = nil
      expect(@reglement).not_to be_valid
    end
    
    it 'ni pas sans adhesion_id' do
      @reglement.adhesion_id = nil
      expect(@reglement).not_to be_valid
    end
    
    it 'ni sans montant' do
      @reglement.amount = nil
      expect(@reglement).not_to be_valid
    end
    
    it 'qui doit être positif' do
      @reglement.amount = -5.55
      expect(@reglement).not_to be_valid
    end
    
  end
  
end
  

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
adherent-0.3.4 spec/models/adherent/reglement_spec.rb
adherent-0.3.3 spec/models/adherent/reglement_spec.rb
adherent-0.3.2 spec/models/adherent/reglement_spec.rb
adherent-0.3.1 spec/models/adherent/reglement_spec.rb
adherent-0.3.0 spec/models/adherent/reglement_spec.rb
adherent-0.2.9 spec/models/adherent/reglement_spec.rb
adherent-0.2.8 spec/models/adherent/reglement_spec.rb
adherent-0.2.7 spec/models/adherent/reglement_spec.rb
adherent-0.2.6 spec/models/adherent/reglement_spec.rb
adherent-0.2.5 spec/models/adherent/reglement_spec.rb
adherent-0.2.4 spec/models/adherent/reglement_spec.rb
adherent-0.2.3 spec/models/adherent/reglement_spec.rb
adherent-0.2.2.4 spec/models/adherent/reglement_spec.rb
adherent-0.2.2.3 spec/models/adherent/reglement_spec.rb
adherent-0.2.2.2 spec/models/adherent/reglement_spec.rb
adherent-0.2.2.1 spec/models/adherent/reglement_spec.rb
adherent-0.2.2 spec/models/adherent/reglement_spec.rb
adherent-0.2.1 spec/models/adherent/reglement_spec.rb
adherent-0.2.0 spec/models/adherent/reglement_spec.rb
adherent-0.1.10 spec/models/adherent/reglement_spec.rb