osm 1.2.17 → 1.2.18.dev

Sign up to get free protection for your applications and to get access to all the features.
@@ -89,13 +89,13 @@ describe "Badges" do
89
89
  FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/ext/badges/due/?action=get&section=cubs&sectionid=1&termid=2", :body => data.to_json, :content_type => 'application/json')
90
90
 
91
91
  db = Osm::Badges.get_due_badges(@api, Osm::Section.new(:id => 1, :type => :cubs), 2)
92
- db.empty?.should be_false
92
+ db.empty?.should == false
93
93
  db.badge_names.should == {'145_0_1'=>'Activity - Badge Name', '93_0_2'=>'Staged - Participation (Lvl 2)'}
94
94
  db.by_member.should == {1=>['93_0_2', '145_0_1'], 2=>['93_0_2']}
95
95
  db.member_names.should == {1 => 'John Doe', 2 => 'Jane Doe'}
96
96
  db.badge_stock.should == {'93_0_2'=>20, '145_0_1'=>10}
97
97
  db.totals.should == {'93_0_2'=>2, '145_0_1'=>1}
98
- db.valid?.should be_true
98
+ db.valid?.should == true
99
99
  end
100
100
 
101
101
  it "handles an empty array representing no due badges" do
@@ -138,13 +138,13 @@ describe "Badges" do
138
138
  }}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"ok":true}'}) }
139
139
 
140
140
  section = Osm::Section.new(:id => 2, :type => :beavers)
141
- Osm::Badges.update_stock(@api, section, 3, 10).should be_true
141
+ Osm::Badges.update_stock(@api, section, 3, 10).should == true
142
142
  end
143
143
 
144
144
  it "Fails" do
145
145
  HTTParty.stub(:post) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"ok":false}'}) }
146
146
  section = Osm::Section.new(:id => 1, :type => :beavers)
147
- Osm::Badges.update_stock(@api, section, 3, 10).should be_false
147
+ Osm::Badges.update_stock(@api, section, 3, 10).should == false
148
148
  end
149
149
 
150
150
  end
@@ -14,7 +14,7 @@ describe "Budget" do
14
14
  b.id.should == 1
15
15
  b.section_id.should == 2
16
16
  b.name.should == 'Name'
17
- b.valid?.should be_true
17
+ b.valid?.should == true
18
18
  end
19
19
 
20
20
  it "Sorts Budget by section ID then name" do
@@ -74,7 +74,7 @@ describe "Budget" do
74
74
  'row' => 0,
75
75
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":true}'}) }
76
76
 
77
- budget.create(@api).should be_true
77
+ budget.create(@api).should == true
78
78
  budget.id.should == 4
79
79
  end
80
80
 
@@ -93,7 +93,7 @@ describe "Budget" do
93
93
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":true}'}) }
94
94
  Osm::Budget.should_receive(:get_for_section).with(@api, 2, {:no_cache=>true}) { [Osm::Budget.new(:id => 3, :section_id => 2, :name => 'Existing budget')] }
95
95
 
96
- budget.create(@api).should be_false
96
+ budget.create(@api).should == false
97
97
  end
98
98
 
99
99
  it "Create budget (failure (not updated))" do
@@ -123,7 +123,7 @@ describe "Budget" do
123
123
  'row' => 0,
124
124
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":false}'}) }
125
125
 
126
- budget.create(@api).should be_false
126
+ budget.create(@api).should == false
127
127
  end
128
128
 
129
129
  it "Update budget (success)" do
@@ -146,7 +146,7 @@ describe "Budget" do
146
146
  'row' => 0,
147
147
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":true}'}) }
148
148
 
149
- budget.update(@api).should be_true
149
+ budget.update(@api).should == true
150
150
  end
151
151
 
152
152
  it "Update budget (failure)" do
@@ -158,7 +158,7 @@ describe "Budget" do
158
158
 
159
159
  HTTParty.should_receive(:post) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":false}'}) }
160
160
 
161
- budget.update(@api).should be_false
161
+ budget.update(@api).should == false
162
162
  end
163
163
 
164
164
  it "Delete budget (success)" do
@@ -177,7 +177,7 @@ describe "Budget" do
177
177
  'categoryid' => 1,
178
178
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":true}'}) }
179
179
 
180
- budget.delete(@api).should be_true
180
+ budget.delete(@api).should == true
181
181
  end
182
182
 
183
183
  it "Delete budget (failure)" do
@@ -196,7 +196,7 @@ describe "Budget" do
196
196
  'categoryid' => 1,
197
197
  }) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body => '{"ok":false}'}) }
198
198
 
199
- budget.delete(@api).should be_false
199
+ budget.delete(@api).should == false
200
200
  end
201
201
 
202
202
  end
@@ -37,35 +37,35 @@ describe "Event" do
37
37
  event.cost.should == '1.23'
38
38
  event.location.should == 'Somewhere'
39
39
  event.notes.should == 'None'
40
- event.archived.should be_false
40
+ event.archived.should == false
41
41
  event.badges.should == []
42
42
  event.columns.should == []
43
43
  event.notepad.should == 'notepad'
44
44
  event.public_notepad.should == 'public notepad'
45
45
  event.confirm_by_date.should == Date.new(2002, 1, 2)
46
- event.allow_changes.should be_true
47
- event.reminders.should be_false
46
+ event.allow_changes.should == true
47
+ event.reminders.should == false
48
48
  event.attendance_limit.should == 3
49
- event.attendance_limit_includes_leaders.should be_true
49
+ event.attendance_limit_includes_leaders.should == true
50
50
  event.attendance_reminder.should == 14
51
- event.allow_booking.should be_false
52
- event.valid?.should be_true
51
+ event.allow_booking.should == false
52
+ event.valid?.should == true
53
53
  end
54
54
 
55
55
  it "Tells if attendance is limited" do
56
- Osm::Event.new(:attendance_limit => 0).limited_attendance?.should be_false
57
- Osm::Event.new(:attendance_limit => 1).limited_attendance?.should be_true
56
+ Osm::Event.new(:attendance_limit => 0).limited_attendance?.should == false
57
+ Osm::Event.new(:attendance_limit => 1).limited_attendance?.should == true
58
58
  end
59
59
 
60
60
  it "Tells if the cost is TBC" do
61
- Osm::Event.new(:cost => 'TBC').cost_tbc?.should be_true
62
- Osm::Event.new(:cost => '1.23').cost_tbc?.should be_false
61
+ Osm::Event.new(:cost => 'TBC').cost_tbc?.should == true
62
+ Osm::Event.new(:cost => '1.23').cost_tbc?.should == false
63
63
  end
64
64
 
65
65
  it "Tells if the cost is free" do
66
- Osm::Event.new(:cost => 'TBC').cost_free?.should be_false
67
- Osm::Event.new(:cost => '1.23').cost_free?.should be_false
68
- Osm::Event.new(:cost => '0.00').cost_free?.should be_true
66
+ Osm::Event.new(:cost => 'TBC').cost_free?.should == false
67
+ Osm::Event.new(:cost => '1.23').cost_free?.should == false
68
+ Osm::Event.new(:cost => '0.00').cost_free?.should == true
69
69
  end
70
70
 
71
71
  it "Sorts by start, name then ID (unless IDs are equal)" do
@@ -105,7 +105,7 @@ describe "Event" do
105
105
  ea.last_name.should == 'Last'
106
106
  ea.date_of_birth.should == Date.new(2000, 1, 2)
107
107
  ea.attending.should == :yes
108
- ea.valid?.should be_true
108
+ ea.valid?.should == true
109
109
  end
110
110
 
111
111
  it "Sorts by event ID then row" do
@@ -141,7 +141,7 @@ describe "Event" do
141
141
  bl.requirement_id.should == 2
142
142
  bl.requirement_label.should == 'A: Poster'
143
143
  bl.data.should == 'abc'
144
- bl.valid?.should be_true
144
+ bl.valid?.should == true
145
145
  end
146
146
 
147
147
  end
@@ -225,20 +225,20 @@ describe "Event" do
225
225
  event.cost.should == '0.00'
226
226
  event.location.should == 'Somewhere'
227
227
  event.notes.should == 'Notes'
228
- event.archived.should be_false
228
+ event.archived.should == false
229
229
  event.notepad.should == 'notepad'
230
230
  event.public_notepad.should == 'public notepad'
231
231
  event.confirm_by_date.should == Date.new(2002, 1, 2)
232
- event.allow_changes.should be_true
233
- event.reminders.should be_false
232
+ event.allow_changes.should == true
233
+ event.reminders.should == false
234
234
  event.attendance_limit.should == 3
235
- event.attendance_limit_includes_leaders.should be_true
235
+ event.attendance_limit_includes_leaders.should == true
236
236
  event.attendance_reminder.should == 7
237
- event.allow_booking.should be_true
237
+ event.allow_booking.should == true
238
238
  event.columns[0].id.should == 'f_1'
239
239
  event.columns[0].name.should == 'Name'
240
240
  event.columns[0].label.should == 'Label'
241
- event.columns[0].parent_required.should be_true
241
+ event.columns[0].parent_required.should == true
242
242
  event.badges[0].badge_name.should == 'Athletics'
243
243
  event.badges[0].badge_section.should == :cubs
244
244
  event.badges[0].badge_type.should == :activity
@@ -252,7 +252,7 @@ describe "Event" do
252
252
  event.badges[1].badge_type.should == :staged
253
253
  event.badges[1].requirement_id.should == 4
254
254
  event.badges[1].data.should == '1'
255
- event.valid?.should be_true
255
+ event.valid?.should == true
256
256
  end
257
257
 
258
258
  it "Handles a blank config" do
@@ -268,7 +268,7 @@ describe "Event" do
268
268
  events = Osm::Event.get_for_section(@api, 1)
269
269
  event = events[0]
270
270
  event.cost.should == 'TBC'
271
- event.valid?.should be_true
271
+ event.valid?.should == true
272
272
  end
273
273
 
274
274
  it "From cache" do
@@ -356,7 +356,7 @@ describe "Event" do
356
356
 
357
357
  it "No limit" do
358
358
  event = Osm::Event.new(:attendance_limit => 0, :id => 1, :section_id => 2)
359
- event.spaces?(@api).should be_true
359
+ event.spaces?(@api).should == true
360
360
  event.spaces(@api).should be_nil
361
361
  end
362
362
 
@@ -379,7 +379,7 @@ describe "Event" do
379
379
  Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
380
380
 
381
381
  event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
382
- event.spaces?(@api).should be_true
382
+ event.spaces?(@api).should == true
383
383
  event.spaces(@api).should == 1
384
384
  end
385
385
 
@@ -418,7 +418,7 @@ describe "Event" do
418
418
  Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
419
419
 
420
420
  event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
421
- event.spaces?(@api).should be_false
421
+ event.spaces?(@api).should == false
422
422
  event.spaces(@api).should == -1
423
423
  end
424
424
 
@@ -449,7 +449,7 @@ describe "Event" do
449
449
  Osm::Term.stub(:get_current_term_for_section) { Osm::Term.new(:id => 3) }
450
450
 
451
451
  event = Osm::Event.new(:attendance_limit => 2, :id => 1, :section_id => 2)
452
- event.spaces?(@api).should be_false
452
+ event.spaces?(@api).should == false
453
453
  event.spaces(@api).should == 0
454
454
  end
455
455
 
@@ -788,7 +788,7 @@ describe "Event" do
788
788
  event.name = 'Test event'
789
789
  event.notepad = 'notepad'
790
790
  event.public_notepad = 'public notepad'
791
- event.update(@api).should be_true
791
+ event.update(@api).should == true
792
792
  end
793
793
 
794
794
  it "TBC cost" do
@@ -838,7 +838,7 @@ describe "Event" do
838
838
  :allow_booking => true,
839
839
  )
840
840
  event.cost = 'TBC'
841
- event.update(@api).should be_true
841
+ event.update(@api).should == true
842
842
  end
843
843
 
844
844
  describe "Badge links" do
@@ -890,7 +890,7 @@ describe "Event" do
890
890
  @event.should_receive(:add_badge_link).with(@api, badge) { true }
891
891
 
892
892
  @event.badges.push(badge)
893
- @event.update(@api).should be_true
893
+ @event.update(@api).should == true
894
894
  end
895
895
 
896
896
  it "Removed" do
@@ -911,7 +911,7 @@ describe "Event" do
911
911
  HTTParty.should_receive(:post).with(url, {:body => post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"status":true}'}) }
912
912
 
913
913
  @event.badges = []
914
- @event.update(@api).should be_true
914
+ @event.update(@api).should == true
915
915
  end
916
916
 
917
917
  end
@@ -932,7 +932,7 @@ describe "Event" do
932
932
  :id => 2
933
933
  )
934
934
  event.id = 22
935
- event.update(@api).should be_false
935
+ event.update(@api).should == false
936
936
  end
937
937
 
938
938
 
@@ -957,7 +957,7 @@ describe "Event" do
957
957
  :notes => 'none',
958
958
  :id => 2
959
959
  )
960
- event.delete(@api).should be_true
960
+ event.delete(@api).should == true
961
961
  end
962
962
 
963
963
  it "Delete (failed)" do
@@ -973,7 +973,7 @@ describe "Event" do
973
973
  :notes => 'none',
974
974
  :id => 2
975
975
  )
976
- event.delete(@api).should be_false
976
+ event.delete(@api).should == false
977
977
  end
978
978
 
979
979
 
@@ -1000,7 +1000,7 @@ describe "Event" do
1000
1000
 
1001
1001
  event = Osm::Event.new(:id => 2, :section_id => 1)
1002
1002
  attendance = event.get_attendance(@api, 3)
1003
- attendance.is_a?(Array).should be_true
1003
+ attendance.is_a?(Array).should == true
1004
1004
  ea = attendance[0]
1005
1005
  ea.member_id.should == 1
1006
1006
  ea.grouping_id.should == 2
@@ -1084,7 +1084,7 @@ describe "Event" do
1084
1084
  }}
1085
1085
  ) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{}'}) }
1086
1086
 
1087
- ea.update(@api).should be_true
1087
+ ea.update(@api).should == true
1088
1088
  end
1089
1089
 
1090
1090
 
@@ -1107,7 +1107,7 @@ describe "Event" do
1107
1107
 
1108
1108
  event = Osm::Event.new(:id => 2, :section_id => 1)
1109
1109
  event.should_not be_nil
1110
- event.add_column(@api, 'Test name', 'Test label', true).should be_true
1110
+ event.add_column(@api, 'Test name', 'Test label', true).should == true
1111
1111
  column = event.columns[0]
1112
1112
  column.id.should == 'f_1'
1113
1113
  column.name.should == 'Test name'
@@ -1119,7 +1119,7 @@ describe "Event" do
1119
1119
 
1120
1120
  event = Osm::Event.new(:id => 2, :section_id => 1)
1121
1121
  event.should_not be_nil
1122
- event.add_column(@api, 'Test name', 'Test label').should be_false
1122
+ event.add_column(@api, 'Test name', 'Test label').should == false
1123
1123
  end
1124
1124
 
1125
1125
 
@@ -1148,7 +1148,7 @@ describe "Event" do
1148
1148
  column.label = 'New label'
1149
1149
  column.parent_required = true
1150
1150
 
1151
- column.update(@api).should be_true
1151
+ column.update(@api).should == true
1152
1152
 
1153
1153
  column.name.should == 'New name'
1154
1154
  column.label.should == 'New label'
@@ -1162,7 +1162,7 @@ describe "Event" do
1162
1162
  event = Osm::Event.new(:id => 2, :section_id => 1)
1163
1163
  column = Osm::Event::Column.new(:id => 'f_1', :event => event)
1164
1164
  event.columns = [column]
1165
- column.update(@api).should be_false
1165
+ column.update(@api).should == false
1166
1166
  end
1167
1167
 
1168
1168
 
@@ -1182,7 +1182,7 @@ describe "Event" do
1182
1182
  column = Osm::Event::Column.new(:id => 'f_1', :event => event)
1183
1183
  event.columns = [column]
1184
1184
 
1185
- column.delete(@api).should be_true
1185
+ column.delete(@api).should == true
1186
1186
  event.columns.should == []
1187
1187
  end
1188
1188
 
@@ -1192,7 +1192,7 @@ describe "Event" do
1192
1192
  event = Osm::Event.new(:id => 2, :section_id => 1)
1193
1193
  column = Osm::Event::Column.new(:id => 'f_1', :event => event)
1194
1194
  event.columns = [column]
1195
- column.delete(@api).should be_false
1195
+ column.delete(@api).should == false
1196
1196
  end
1197
1197
 
1198
1198
  it "Get audit trail" do
@@ -14,7 +14,7 @@ describe "Flexi Record" do
14
14
  fr.id.should == 1
15
15
  fr.section_id.should == 2
16
16
  fr.name.should == 'name'
17
- fr.valid?.should be_true
17
+ fr.valid?.should == true
18
18
  end
19
19
 
20
20
  describe "FlexiRecord::Column" do
@@ -29,8 +29,8 @@ describe "Flexi Record" do
29
29
 
30
30
  field.id.should == 'f_1'
31
31
  field.name.should == 'Field Name'
32
- field.editable.should be_true
33
- field.valid?.should be_true
32
+ field.editable.should == true
33
+ field.valid?.should == true
34
34
  end
35
35
 
36
36
  it "Sorts by flexirecord then id (system first then user)" do
@@ -78,7 +78,7 @@ describe "Flexi Record" do
78
78
  'f_1' => 'a',
79
79
  'f_2' => 'b',
80
80
  }
81
- rd.valid?.should be_true
81
+ rd.valid?.should == true
82
82
  end
83
83
 
84
84
  it "Sorts by flexirecord, grouping_id then member_id" do
@@ -147,8 +147,8 @@ describe "Flexi Record" do
147
147
  FakeWeb.register_uri(:post, "https://www.onlinescoutmanager.co.uk/extras.php?action=getExtra&sectionid=1&extraid=2", :body => data.to_json, :content_type => 'application/json')
148
148
 
149
149
  fields = @flexi_record.get_columns(@api)
150
- fields.is_a?(Array).should be_true
151
- fields[0].valid?.should be_true
150
+ fields.is_a?(Array).should == true
151
+ fields[0].valid?.should == true
152
152
  fields[0].id.should == 'firstname'
153
153
  fields[1].id.should == 'lastname'
154
154
  fields[2].id.should == 'f_1'
@@ -188,7 +188,7 @@ describe "Flexi Record" do
188
188
  }
189
189
  HTTParty.should_receive(:post).with(url, {:body => post_data}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>data.to_json}) }
190
190
 
191
- @flexi_record.add_column(@api, 'name').should be_true
191
+ @flexi_record.add_column(@api, 'name').should == true
192
192
  end
193
193
 
194
194
  it "Add field (failure)" do
@@ -213,7 +213,7 @@ describe "Flexi Record" do
213
213
  }
214
214
  HTTParty.should_receive(:post) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>data.to_json}) }
215
215
 
216
- @flexi_record.add_column(@api, 'name').should be_false
216
+ @flexi_record.add_column(@api, 'name').should == false
217
217
  end
218
218
 
219
219
  it "Update field (success)" do
@@ -256,7 +256,7 @@ describe "Flexi Record" do
256
256
  :name => 'name',
257
257
  :editable => true
258
258
  )
259
- col.update(@api).should be_true
259
+ col.update(@api).should == true
260
260
  end
261
261
 
262
262
  it "Update field (failure)" do
@@ -287,7 +287,7 @@ describe "Flexi Record" do
287
287
  :name => 'name',
288
288
  :editable => true
289
289
  )
290
- col.update(@api).should be_false
290
+ col.update(@api).should == false
291
291
  end
292
292
 
293
293
  it "Update field (uneditable)" do
@@ -338,7 +338,7 @@ describe "Flexi Record" do
338
338
  :name => 'name',
339
339
  :editable => true
340
340
  )
341
- col.delete(@api).should be_true
341
+ col.delete(@api).should == true
342
342
  end
343
343
 
344
344
  it "Delete field (failure)" do
@@ -369,7 +369,7 @@ describe "Flexi Record" do
369
369
  :name => 'name',
370
370
  :editable => true
371
371
  )
372
- col.delete(@api).should be_false
372
+ col.delete(@api).should == false
373
373
  end
374
374
 
375
375
  it "Delete field (uneditable)" do
@@ -404,7 +404,7 @@ describe "Flexi Record" do
404
404
  Osm::Section.stub(:get) { Osm::Section.new(:id => 1, :type => :cubs) }
405
405
 
406
406
  records = @flexi_record.get_data(@api, 3)
407
- records.is_a?(Array).should be_true
407
+ records.is_a?(Array).should == true
408
408
  records.size.should == 1
409
409
  record = records[0]
410
410
  record.member_id.should == 1
@@ -419,7 +419,7 @@ describe "Flexi Record" do
419
419
  'f_1' => 'A',
420
420
  'f_2' => 'B',
421
421
  }
422
- record.valid?.should be_true
422
+ record.valid?.should == true
423
423
  end
424
424
 
425
425
 
@@ -456,7 +456,7 @@ describe "Flexi Record" do
456
456
  :fields => {'f_1' => '', 'f_2' => 'value'}
457
457
  )
458
458
  fr_data.fields['f_1'] = 'value'
459
- fr_data.update(@api).should be_true
459
+ fr_data.update(@api).should == true
460
460
  end
461
461
 
462
462
  it "Update data (failed)" do
@@ -479,7 +479,7 @@ describe "Flexi Record" do
479
479
  :fields => {'f_1' => 'old value'}
480
480
  )
481
481
  fr_data.fields['f_1'] = 'new value'
482
- fr_data.update(@api).should be_false
482
+ fr_data.update(@api).should == false
483
483
  end
484
484
 
485
485
  it "Update data (uneditable field)" do
@@ -494,7 +494,7 @@ describe "Flexi Record" do
494
494
  :grouping_id => 5,
495
495
  :fields => {'f_1' => 'value'}
496
496
  )
497
- fr_data.update(@api).should be_true
497
+ fr_data.update(@api).should == true
498
498
  end
499
499
 
500
500
 
@@ -532,7 +532,7 @@ describe "Flexi Record" do
532
532
  Osm::Section.stub(:get) { Osm::Section.new(:id => 1, :type => :cubs) }
533
533
 
534
534
  records = @flexi_record.get_data(@api, 3)
535
- records.is_a?(Array).should be_true
535
+ records.is_a?(Array).should == true
536
536
  records.size.should == 1
537
537
  record = records[0]
538
538
  record.member_id.should == 1