adherent 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/adherent/application.js +1 -0
  3. data/app/assets/javascripts/adherent/datatableinit.js +125 -0
  4. data/app/assets/javascripts/adherent/members.js +1 -96
  5. data/app/assets/stylesheets/adherent/print.css.scss +1 -1
  6. data/app/models/adherent/query_member.rb +3 -3
  7. data/app/views/adherent/members/index.html.erb +1 -1
  8. data/lib/adherent/version.rb +2 -1
  9. data/spec/dummy/log/development.log +730 -0
  10. data/spec/dummy/log/test.log +30168 -0
  11. data/spec/dummy/tmp/cache/assets/development/sass/be6a31d2c99b18f66f4f3f1b46bb0b8c5ef54ab1/print.css.scssc +0 -0
  12. data/spec/dummy/tmp/cache/assets/development/sprockets/0d215f323ff7a120168496bc58ed75a3 +0 -0
  13. data/spec/dummy/tmp/cache/assets/development/sprockets/20a218b05c2726d14bd025c36ba31ddd +0 -0
  14. data/spec/dummy/tmp/cache/assets/development/sprockets/22948c5cb4a59a4c252888f75cdf387a +0 -0
  15. data/spec/dummy/tmp/cache/assets/development/sprockets/2c60d0f2e80cc940437007413465285a +0 -0
  16. data/spec/dummy/tmp/cache/assets/development/sprockets/3f2a439772fcd9cd0f434f723837ae51 +0 -0
  17. data/spec/dummy/tmp/cache/assets/development/sprockets/7566b213016e5bc90381985bbae7e445 +0 -0
  18. data/spec/dummy/tmp/cache/assets/development/sprockets/850d92cf676cc2c2c662ee8dc328f82c +0 -0
  19. data/spec/dummy/tmp/cache/assets/development/sprockets/8e3cd5dcbc6987a1bab580133dd4091a +0 -0
  20. data/spec/dummy/tmp/cache/assets/development/sprockets/992d715e0153da278420d380aa63b412 +0 -0
  21. data/spec/dummy/tmp/cache/assets/development/sprockets/c35251b000451b1b9f7274e0ae471704 +0 -0
  22. data/spec/dummy/tmp/cache/assets/development/sprockets/d27d4e6bd84d0108fc54a21959181335 +0 -0
  23. data/spec/dummy/tmp/cache/assets/development/sprockets/d88c0d3362ebdb47849b797a3ec1b355 +0 -0
  24. data/spec/dummy/tmp/cache/assets/development/sprockets/dce67637c5015fb918e48897a4e6c96a +0 -0
  25. data/spec/dummy/tmp/cache/assets/development/sprockets/e17667e7004e5cfc7f733b8762f47c3f +0 -0
  26. data/spec/dummy/tmp/cache/assets/development/sprockets/fca89522784c8592001dc314a2361344 +0 -0
  27. data/spec/dummy/tmp/cache/assets/test/sass/be6a31d2c99b18f66f4f3f1b46bb0b8c5ef54ab1/print.css.scssc +0 -0
  28. data/spec/dummy/tmp/cache/assets/test/sprockets/20a218b05c2726d14bd025c36ba31ddd +0 -0
  29. data/spec/dummy/tmp/cache/assets/test/sprockets/22948c5cb4a59a4c252888f75cdf387a +0 -0
  30. data/spec/dummy/tmp/cache/assets/test/sprockets/3f2a439772fcd9cd0f434f723837ae51 +0 -0
  31. data/spec/dummy/tmp/cache/assets/test/sprockets/850d92cf676cc2c2c662ee8dc328f82c +0 -0
  32. data/spec/dummy/tmp/cache/assets/test/sprockets/8e3cd5dcbc6987a1bab580133dd4091a +0 -0
  33. data/spec/dummy/tmp/cache/assets/test/sprockets/992d715e0153da278420d380aa63b412 +0 -0
  34. data/spec/dummy/tmp/cache/assets/test/sprockets/c35251b000451b1b9f7274e0ae471704 +0 -0
  35. data/spec/dummy/tmp/cache/assets/test/sprockets/d27d4e6bd84d0108fc54a21959181335 +0 -0
  36. data/spec/dummy/tmp/cache/assets/test/sprockets/d88c0d3362ebdb47849b797a3ec1b355 +0 -0
  37. data/spec/dummy/tmp/cache/assets/test/sprockets/dce67637c5015fb918e48897a4e6c96a +0 -0
  38. data/spec/dummy/tmp/cache/assets/test/sprockets/e17667e7004e5cfc7f733b8762f47c3f +0 -0
  39. data/spec/dummy/tmp/cache/assets/test/sprockets/fca89522784c8592001dc314a2361344 +0 -0
  40. data/spec/dummy/tmp/pids/server.pid +1 -0
  41. data/spec/features/js_spec.rb +1 -1
  42. data/spec/models/adherent/query_member_spec.rb +43 -33
  43. metadata +15 -2
@@ -0,0 +1 @@
1
+ 8455
@@ -44,7 +44,7 @@ describe 'javascript requests', :type => :feature do
44
44
  alert = page.driver.browser.switch_to.alert
45
45
  alert.accept
46
46
  sleep 1
47
- expect(Adherent::Member.count).to eq(4)
47
+ expect(Adherent::Member.count).to eq(4)
48
48
  end
49
49
  end
50
50
 
@@ -15,6 +15,8 @@ describe Adherent::QueryMember, :type => :model do
15
15
  birthdate:Date.civil(1955,6,6)}
16
16
  end
17
17
 
18
+ let(:org) {double(Organism, id:1)}
19
+
18
20
  before(:each) do
19
21
  @m = Adherent::Member.new(valid_attributes)
20
22
  @m.organism_id = 1
@@ -29,11 +31,11 @@ describe Adherent::QueryMember, :type => :model do
29
31
  end
30
32
 
31
33
  it 'on peut initier un query_member' do
32
- expect(Adherent::QueryMember.count).to eq(1)
34
+ expect(Adherent::QueryMember.query_members(org).size).to eq(1)
33
35
  end
34
36
 
35
37
  it 'dont les champs sont corrects' do
36
- m = Adherent::QueryMember.first
38
+ m = Adherent::QueryMember.query_members(org).first
37
39
  expect(m.birthdate).to eq('06/06/1955')
38
40
  expect(m.name).to eq(@m.name)
39
41
  expect(m.forname).to eq(@m.forname)
@@ -53,7 +55,7 @@ describe Adherent::QueryMember, :type => :model do
53
55
  end
54
56
 
55
57
  it 'donne la bonne fin d adhésion' do
56
- m = Adherent::QueryMember.first
58
+ m = Adherent::QueryMember.query_members(org).first
57
59
  expect(m.m_to_date).to eq(I18n::l((Date.today.beginning_of_year>>2) -1))
58
60
  end
59
61
 
@@ -75,7 +77,7 @@ describe Adherent::QueryMember, :type => :model do
75
77
  end
76
78
 
77
79
  it 'le membre doit encore 14.26 ' do
78
- m = Adherent::QueryMember.first
80
+ m = Adherent::QueryMember.query_members(org).first
79
81
  expect(m.t_reglements).to eq(8)
80
82
  expect(m.t_adhesions).to eq(22.26)
81
83
  expect(m.montant_du).to eq(14.26)
@@ -85,7 +87,7 @@ describe Adherent::QueryMember, :type => :model do
85
87
  @p = @m.payments.new(date:Date.today, amount:10.26, mode:'CB')
86
88
  allow(@p).to receive(:correct_range_date).and_return true
87
89
  @p.save
88
- m = Adherent::QueryMember.first
90
+ m = Adherent::QueryMember.query_members(org).first
89
91
  expect(m.montant_du).to eq(4)
90
92
  expect(m.a_jour?).to be false
91
93
  end
@@ -96,7 +98,7 @@ describe Adherent::QueryMember, :type => :model do
96
98
  allow(@p).to receive(:correct_range_date).and_return true
97
99
  allow(@q).to receive(:correct_range_date).and_return true
98
100
  @p.save; @q.save
99
- m = Adherent::QueryMember.first
101
+ m = Adherent::QueryMember.query_members(org).first
100
102
  expect(m.montant_du).to eq(0)
101
103
  expect(m.a_jour?).to be true
102
104
  end
@@ -107,7 +109,7 @@ describe Adherent::QueryMember, :type => :model do
107
109
  allow(@p).to receive(:correct_range_date).and_return true
108
110
 
109
111
  @p.save
110
- m = Adherent::QueryMember.first
112
+ m = Adherent::QueryMember.query_members(org).first
111
113
  expect(m.montant_du).to eq(0)
112
114
  expect(m.a_jour?).to be true
113
115
  end
@@ -116,40 +118,48 @@ describe Adherent::QueryMember, :type => :model do
116
118
  end
117
119
 
118
120
 
121
+ describe 'export' do
122
+
123
+ def two_lines
124
+ [Adherent::QueryMember.new(number:'Adh 001', name:'Dupont', forname:'Jules',
125
+ birthdate:Date.civil(1955,6,6), mail:'bonjour@example.com',
126
+ tel:'01.02.03.04.05', t_adhesions:22.26, t_reglements:0,
127
+ m_to_date:((Date.today.beginning_of_year >> 2) -1))
128
+ ]
129
+ end
130
+
119
131
 
120
-
121
- describe 'to_csv' do
132
+ describe 'to_csv' do
122
133
 
123
- before(:each) do
124
- @organism = double(Organism, id:1)
125
- allow(Adherent::QueryMember).to receive(:query_members).with(@organism).
126
- and_return(Adherent::QueryMember.all)
127
- csv = Adherent::QueryMember.to_csv(@organism)
128
- @lignes = csv.split("\n")
129
- end
130
- it 'la ligne de titre' do
131
- expect(@lignes[0]).to eq("Numero\tNom\tPrénom\tDate de naissance\tMail\tTél\tDoit\tFin Adh.")
132
- end
134
+ before(:each) do
135
+ @organism = double(Organism, id:1)
136
+ allow(Adherent::QueryMember).to receive(:query_members).with(@organism).
137
+ and_return(two_lines)
138
+ csv = Adherent::QueryMember.to_csv(@organism)
139
+ @lignes = csv.split("\n")
140
+ end
141
+ it 'la ligne de titre' do
142
+ expect(@lignes[0]).to eq("Numero\tNom\tPrénom\tDate de naissance\tMail\tTél\tDoit\tFin Adh.")
143
+ end
133
144
 
134
- it 'une ligne de valeurs' do
135
- expect(@lignes[1]).to eq("Adh 001\tDupont\tJules\t06/06/1955\tbonjour@example.com\t01.02.03.04.05\t22,26\t#{I18n::l((Date.today.beginning_of_year>>2) -1)}")
145
+ it 'une ligne de valeurs' do
146
+ expect(@lignes[1]).to eq("Adh 001\tDupont\tJules\t06/06/1955\tbonjour@example.com\t01.02.03.04.05\t22,26\t#{I18n::l((Date.today.beginning_of_year>>2) -1)}")
147
+ end
148
+
136
149
  end
137
-
138
-
139
- end
140
150
 
141
- describe 'to_xls' do
142
- before(:each) do
143
- @organism = double(Organism, id:1)
144
- allow(Adherent::QueryMember).to receive(:query_members).with(@organism).
145
- and_return(Adherent::QueryMember.all)
146
- end
151
+ describe 'to_xls' do
152
+ before(:each) do
153
+ @organism = double(Organism, id:1)
154
+ allow(Adherent::QueryMember).to receive(:query_members).with(@organism).
155
+ and_return(two_lines)
156
+ end
147
157
 
148
- it 'to_xls doit marcher également' do
149
- expect {Adherent::QueryMember.to_xls(@organism)}.not_to raise_error
158
+ it 'to_xls doit marcher également' do
159
+ expect {Adherent::QueryMember.to_xls(@organism)}.not_to raise_error
160
+ end
150
161
  end
151
162
  end
152
-
153
163
  end
154
164
 
155
165
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adherent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Claude Lepage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-16 00:00:00.000000000 Z
11
+ date: 2015-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sprockets-rails
@@ -356,6 +356,7 @@ files:
356
356
  - app/assets/javascripts/adherent/application.js
357
357
  - app/assets/javascripts/adherent/common.js
358
358
  - app/assets/javascripts/adherent/coords.js
359
+ - app/assets/javascripts/adherent/datatableinit.js
359
360
  - app/assets/javascripts/adherent/date_picker.js
360
361
  - app/assets/javascripts/adherent/jquery.dataTables.min.js
361
362
  - app/assets/javascripts/adherent/members.js
@@ -743,6 +744,7 @@ files:
743
744
  - spec/dummy/tmp/cache/assets/development/sprockets/0c418a7e3c6101ef6e3c008f3e550abe
744
745
  - spec/dummy/tmp/cache/assets/development/sprockets/0cf09b6bd4058afb7797d332f36bdd68
745
746
  - spec/dummy/tmp/cache/assets/development/sprockets/0d14e869566ca526fbdbbbc488475003
747
+ - spec/dummy/tmp/cache/assets/development/sprockets/0d215f323ff7a120168496bc58ed75a3
746
748
  - spec/dummy/tmp/cache/assets/development/sprockets/0ea4d583ba95e0c1eb3b926932571034
747
749
  - spec/dummy/tmp/cache/assets/development/sprockets/0eacb9cfe91deee88befb653c4ca2953
748
750
  - spec/dummy/tmp/cache/assets/development/sprockets/0ec565b2aab8a3ae9211952ed56f1a70
@@ -914,6 +916,7 @@ files:
914
916
  - spec/dummy/tmp/cache/assets/development/sprockets/8c382a2a9aab338b046cc3fe6d47f435
915
917
  - spec/dummy/tmp/cache/assets/development/sprockets/8c5ffb42727c5fc7794ac3c608b17c2e
916
918
  - spec/dummy/tmp/cache/assets/development/sprockets/8d46886219801353094d82d2e0b36f73
919
+ - spec/dummy/tmp/cache/assets/development/sprockets/8e3cd5dcbc6987a1bab580133dd4091a
917
920
  - spec/dummy/tmp/cache/assets/development/sprockets/8ea4f850c201e8912b42b4bc3e997211
918
921
  - spec/dummy/tmp/cache/assets/development/sprockets/8f1b44c5518c8e16b2b9636ec6ea9c5b
919
922
  - spec/dummy/tmp/cache/assets/development/sprockets/8f27ca529693572686fb951ba66e32e9
@@ -932,6 +935,7 @@ files:
932
935
  - spec/dummy/tmp/cache/assets/development/sprockets/97829b155233b6d466bc829fff627287
933
936
  - spec/dummy/tmp/cache/assets/development/sprockets/97f59d5e32c82d6c6f80530dd59eb1e5
934
937
  - spec/dummy/tmp/cache/assets/development/sprockets/9909959901922ff5ee27206a9e56a99d
938
+ - spec/dummy/tmp/cache/assets/development/sprockets/992d715e0153da278420d380aa63b412
935
939
  - spec/dummy/tmp/cache/assets/development/sprockets/9a6548b678d621a1b9f0f9f27f130113
936
940
  - spec/dummy/tmp/cache/assets/development/sprockets/9b29bbccf28796fd330aa7ad92d137e1
937
941
  - spec/dummy/tmp/cache/assets/development/sprockets/9b410af44867a4979d1aea0ab84ed24b
@@ -1304,6 +1308,7 @@ files:
1304
1308
  - spec/dummy/tmp/cache/assets/test/sprockets/8a7a27749f2f76175627ed4084e5ae1b
1305
1309
  - spec/dummy/tmp/cache/assets/test/sprockets/8c382a2a9aab338b046cc3fe6d47f435
1306
1310
  - spec/dummy/tmp/cache/assets/test/sprockets/8c5ffb42727c5fc7794ac3c608b17c2e
1311
+ - spec/dummy/tmp/cache/assets/test/sprockets/8e3cd5dcbc6987a1bab580133dd4091a
1307
1312
  - spec/dummy/tmp/cache/assets/test/sprockets/8ea4f850c201e8912b42b4bc3e997211
1308
1313
  - spec/dummy/tmp/cache/assets/test/sprockets/8f1b44c5518c8e16b2b9636ec6ea9c5b
1309
1314
  - spec/dummy/tmp/cache/assets/test/sprockets/8f27ca529693572686fb951ba66e32e9
@@ -1317,6 +1322,7 @@ files:
1317
1322
  - spec/dummy/tmp/cache/assets/test/sprockets/97227c6149cc49c443da470997965485
1318
1323
  - spec/dummy/tmp/cache/assets/test/sprockets/973acbad728af4334804dd0454045384
1319
1324
  - spec/dummy/tmp/cache/assets/test/sprockets/97f59d5e32c82d6c6f80530dd59eb1e5
1325
+ - spec/dummy/tmp/cache/assets/test/sprockets/992d715e0153da278420d380aa63b412
1320
1326
  - spec/dummy/tmp/cache/assets/test/sprockets/9b29bbccf28796fd330aa7ad92d137e1
1321
1327
  - spec/dummy/tmp/cache/assets/test/sprockets/9b410af44867a4979d1aea0ab84ed24b
1322
1328
  - spec/dummy/tmp/cache/assets/test/sprockets/9b6859af21d7d645ed13281e6419d6dc
@@ -1432,6 +1438,7 @@ files:
1432
1438
  - spec/dummy/tmp/cache/assets/test/sprockets/fd147c53711773ad70daed13844ec1a4
1433
1439
  - spec/dummy/tmp/cache/assets/test/sprockets/fe43817b9966fa56e9620ebda600f772
1434
1440
  - spec/dummy/tmp/cache/assets/test/sprockets/fef07c3c165353f861564ede180350a4
1441
+ - spec/dummy/tmp/pids/server.pid
1435
1442
  - spec/features/adhesions_spec.rb
1436
1443
  - spec/features/coord_spec.rb
1437
1444
  - spec/features/js_spec.rb
@@ -1500,6 +1507,7 @@ test_files:
1500
1507
  - spec/dummy/log/test.log
1501
1508
  - spec/dummy/log/development.log
1502
1509
  - spec/dummy/Rakefile
1510
+ - spec/dummy/tmp/pids/server.pid
1503
1511
  - spec/dummy/tmp/cache/assets/test/sass/154e667a92d917d35bbad2bca4a67a18286e6047/_variables.scssc
1504
1512
  - spec/dummy/tmp/cache/assets/test/sass/154e667a92d917d35bbad2bca4a67a18286e6047/_modals.scssc
1505
1513
  - spec/dummy/tmp/cache/assets/test/sass/154e667a92d917d35bbad2bca4a67a18286e6047/_carousel.scssc
@@ -1614,6 +1622,7 @@ test_files:
1614
1622
  - spec/dummy/tmp/cache/assets/test/sprockets/a6007699da6bc59ddab5019f88a59065
1615
1623
  - spec/dummy/tmp/cache/assets/test/sprockets/f543d5b5c05af915f4a31b6df4388aeb
1616
1624
  - spec/dummy/tmp/cache/assets/test/sprockets/9b29bbccf28796fd330aa7ad92d137e1
1625
+ - spec/dummy/tmp/cache/assets/test/sprockets/8e3cd5dcbc6987a1bab580133dd4091a
1617
1626
  - spec/dummy/tmp/cache/assets/test/sprockets/6b4a271890f37338b02a9febc97c3daf
1618
1627
  - spec/dummy/tmp/cache/assets/test/sprockets/0701319e027b68d87b4d5727aa571973
1619
1628
  - spec/dummy/tmp/cache/assets/test/sprockets/cb476833cd1a806e251da407a58d9520
@@ -1775,6 +1784,7 @@ test_files:
1775
1784
  - spec/dummy/tmp/cache/assets/test/sprockets/aac72c81c4f00133234e7d1bb46d7925
1776
1785
  - spec/dummy/tmp/cache/assets/test/sprockets/4dd3fce32a54a0f8fb029c30f41d3487
1777
1786
  - spec/dummy/tmp/cache/assets/test/sprockets/c55e2bbc3d3c5566893be021ec1c4ab7
1787
+ - spec/dummy/tmp/cache/assets/test/sprockets/992d715e0153da278420d380aa63b412
1778
1788
  - spec/dummy/tmp/cache/assets/test/sprockets/c571cb715531b81b6777b57546a06732
1779
1789
  - spec/dummy/tmp/cache/assets/test/sprockets/34a4093120a5fc0daec9697570a14cac
1780
1790
  - spec/dummy/tmp/cache/assets/test/sprockets/d27d4e6bd84d0108fc54a21959181335
@@ -1955,6 +1965,7 @@ test_files:
1955
1965
  - spec/dummy/tmp/cache/assets/development/sprockets/df7e1e4d508705c77a96e8deb9d8cf4a
1956
1966
  - spec/dummy/tmp/cache/assets/development/sprockets/f543d5b5c05af915f4a31b6df4388aeb
1957
1967
  - spec/dummy/tmp/cache/assets/development/sprockets/9b29bbccf28796fd330aa7ad92d137e1
1968
+ - spec/dummy/tmp/cache/assets/development/sprockets/8e3cd5dcbc6987a1bab580133dd4091a
1958
1969
  - spec/dummy/tmp/cache/assets/development/sprockets/6b4a271890f37338b02a9febc97c3daf
1959
1970
  - spec/dummy/tmp/cache/assets/development/sprockets/0701319e027b68d87b4d5727aa571973
1960
1971
  - spec/dummy/tmp/cache/assets/development/sprockets/cb476833cd1a806e251da407a58d9520
@@ -2207,6 +2218,7 @@ test_files:
2207
2218
  - spec/dummy/tmp/cache/assets/development/sprockets/e9d3b4c4c90f3be7d3d0abf681e6beb5
2208
2219
  - spec/dummy/tmp/cache/assets/development/sprockets/9edbcadf5d7bd3710cf93d08d9c78cf0
2209
2220
  - spec/dummy/tmp/cache/assets/development/sprockets/c55e2bbc3d3c5566893be021ec1c4ab7
2221
+ - spec/dummy/tmp/cache/assets/development/sprockets/992d715e0153da278420d380aa63b412
2210
2222
  - spec/dummy/tmp/cache/assets/development/sprockets/c571cb715531b81b6777b57546a06732
2211
2223
  - spec/dummy/tmp/cache/assets/development/sprockets/0d14e869566ca526fbdbbbc488475003
2212
2224
  - spec/dummy/tmp/cache/assets/development/sprockets/34a4093120a5fc0daec9697570a14cac
@@ -2273,6 +2285,7 @@ test_files:
2273
2285
  - spec/dummy/tmp/cache/assets/development/sprockets/35ef41173b6f56b97a04b40f0fc1b293
2274
2286
  - spec/dummy/tmp/cache/assets/development/sprockets/4f67efffc5aea8afd7ea072c6ba8712f
2275
2287
  - spec/dummy/tmp/cache/assets/development/sprockets/b08442ed09e0d665d1f3e3218bf6b95a
2288
+ - spec/dummy/tmp/cache/assets/development/sprockets/0d215f323ff7a120168496bc58ed75a3
2276
2289
  - spec/dummy/tmp/cache/assets/development/sprockets/08e67f9b24a565ccbd1124ef05e6a592
2277
2290
  - spec/dummy/tmp/cache/assets/development/sprockets/a82b177f6dddc824750d4f4a75668d9a
2278
2291
  - spec/dummy/tmp/cache/assets/development/sprockets/67537e49bc9ad096d402c7ca903180c4