Sha256: b9c1cf9943be7a81a163655e7971cd0a71310b6cb5f0f401d171e369f132bc79

Contents?: true

Size: 1.98 KB

Versions: 21

Compression:

Stored size: 1.98 KB

Contents

# coding utf-8

require 'rails_helper'
require 'support/fixtures'

RSpec.configure do |c|
  #  c.filter = {wip:true}
end

describe 'ADHESIONS', :type => :feature do  
  include Fixtures 
  
  
  before(:each) do
    create_members(1) 
    @member= @members.first
  end
   
  after(:each) do
    Adherent::Member.delete_all
  end
   
  describe 'création d une adhésion' do
     
    it 'la page new adhesion affiche un form' do
      visit adherent.new_member_adhesion_path @member
      expect(page.find('h3').text).to eq("Renouvellement ou nouvelle adhésion pour #{@member.to_s}")
      expect(page.all('form').size).to eq(1)
    end
     
    it 'remplir le form et cliquer crée une adhésion et renvoie sur la page index' do
      visit adherent.new_member_adhesion_path @member
      fill_in 'Du', with:'01/08/2013'
      fill_in 'Au', with:'31/07/2014'
      fill_in 'Montant', with:'150.25'
      expect {click_button 'Enregistrer'}.to change {@member.adhesions.count}.by(1)
      expect(page.find('h3').text).to eq("Historique des adhésions pour #{@member.to_s}") 
    end
    
    
  end
   
  describe 'la table des adhésions pour un membre' do
    
    before(:each) do
      @member.adhesions.create!(:from_date=>Date.today, :to_date=>Date.today.months_since(1), amount:876.54) 
      visit adherent.member_adhesions_path @member
    end
    
    it 'affiche les adhésions' do
      
      expect(page.find('h3').text).to eq("Historique des adhésions pour #{@member.to_s}")
      expect(page.all('table').size).to eq(1)
    end
    
    describe 'les icones d action' do
      
      it 'edit revoie sur la page de modification' do
        click_link('Modifier')
        expect(page.find('h3').text).to eq("Modification adhésion pour #{@member.to_s}")
      end
      
      it 'money_plus permet d enregistrer un règlement' do
        click_link('Money-plus')
        expect(page.find('h3').text).to eq("Enregistrement d'un paiement de #{@member.to_s}")
      end
      
      
    end
  end
   
   
   
end

Version data entries

21 entries across 21 versions & 1 rubygems

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