adherent 0.3.12 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/adherent/coord.rb +15 -0
- data/lib/adherent/version.rb +2 -1
- data/spec/dummy/log/test.log +7089 -0
- data/spec/models/adherent/coord_spec.rb +13 -2
- metadata +1 -1
@@ -12,8 +12,7 @@ describe 'Coord', :type => :model do
|
|
12
12
|
it 'les coordonnées sont rattachées à un membre' do
|
13
13
|
@c = Adherent::Coord.new()
|
14
14
|
@c.valid?
|
15
|
-
expect(@c.errors[:member_id].size).to eq(1)
|
16
|
-
|
15
|
+
expect(@c.errors[:member_id].size).to eq(1)
|
17
16
|
end
|
18
17
|
|
19
18
|
it 'coord est dépendant du membre' do
|
@@ -26,4 +25,16 @@ describe 'Coord', :type => :model do
|
|
26
25
|
expect{adherent_members(:Durand).destroy}.
|
27
26
|
to change{Adherent::Coord.count}.by -1
|
28
27
|
end
|
28
|
+
|
29
|
+
it 'les données sont nettoyées avant le validation' do
|
30
|
+
c = @m.build_coord(address:"Une adresse avec un blanc en fin ")
|
31
|
+
c.valid?
|
32
|
+
expect(c.address).to eq('Une adresse avec un blanc en fin')
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'un retour a la ligne est également supprimé' do
|
36
|
+
c = @m.build_coord(:address=>"Une adresse avec un retour\n à la ligne\n")
|
37
|
+
c.valid?
|
38
|
+
expect(c.address).to eq("Une adresse avec un retour\n à la ligne")
|
39
|
+
end
|
29
40
|
end
|