bigbluebutton_rails 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/CHANGELOG.rdoc +1 -12
  2. data/Gemfile.lock +1 -1
  3. data/README.rdoc +32 -46
  4. data/Rakefile +1 -0
  5. data/app/controllers/bigbluebutton/rooms_controller.rb +16 -17
  6. data/app/controllers/bigbluebutton/servers_controller.rb +2 -6
  7. data/app/models/bigbluebutton_room.rb +1 -35
  8. data/app/models/bigbluebutton_server.rb +1 -1
  9. data/app/views/bigbluebutton/rooms/_form.html.erb +3 -7
  10. data/app/views/bigbluebutton/rooms/edit.html.erb +2 -2
  11. data/app/views/bigbluebutton/rooms/external.html.erb +1 -2
  12. data/app/views/bigbluebutton/rooms/index.html.erb +37 -2
  13. data/app/views/bigbluebutton/rooms/invite.html.erb +2 -2
  14. data/app/views/bigbluebutton/rooms/join.html.erb +1 -1
  15. data/app/views/bigbluebutton/rooms/new.html.erb +1 -1
  16. data/app/views/bigbluebutton/rooms/show.html.erb +4 -10
  17. data/app/views/bigbluebutton/servers/_activity_list.html.erb +6 -6
  18. data/app/views/bigbluebutton/servers/index.html.erb +3 -4
  19. data/app/views/bigbluebutton/servers/show.html.erb +4 -3
  20. data/config/locales/en.yml +3 -7
  21. data/lib/bigbluebutton_rails/exceptions.rb +0 -4
  22. data/lib/bigbluebutton_rails/rails/routes.rb +35 -28
  23. data/lib/bigbluebutton_rails/version.rb +1 -1
  24. data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +10 -13
  25. data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +13 -13
  26. data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +115 -114
  27. data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +1 -12
  28. data/spec/controllers/bigbluebutton/servers_controller_spec.rb +0 -11
  29. data/spec/generators/install_generator_spec.rb +1 -1
  30. data/spec/models/bigbluebutton_room_spec.rb +80 -166
  31. data/spec/models/bigbluebutton_server_spec.rb +4 -4
  32. data/spec/rails_app/features/activity_monitor_servers.feature +0 -6
  33. data/spec/rails_app/features/create_rooms.feature +0 -5
  34. data/spec/rails_app/features/create_servers.feature +2 -7
  35. data/spec/rails_app/features/edit_rooms.feature +0 -7
  36. data/spec/rails_app/features/edit_servers.feature +2 -8
  37. data/spec/rails_app/features/join_rooms.feature +0 -1
  38. data/spec/rails_app/features/list_and_show_rooms.feature +2 -10
  39. data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +10 -10
  40. data/spec/rails_app/features/step_definitions/common_steps.rb +4 -6
  41. data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +0 -1
  42. data/spec/rails_app/features/step_definitions/join_mobile_steps.rb +3 -1
  43. data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +7 -3
  44. data/spec/rails_app/features/step_definitions/list_and_show_rooms_steps.rb +5 -12
  45. data/spec/rails_app/features/step_definitions/list_and_show_servers_steps.rb +5 -1
  46. data/spec/rails_app/features/support/{patches/application_controller.rb → application_controller.rb} +0 -0
  47. data/spec/rails_app/features/support/paths.rb +10 -12
  48. data/spec/rails_app/features/support/templates.rb +46 -90
  49. data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +22 -38
  50. data/spec/routing/bigbluebutton/rooms_routing_spec.rb +58 -142
  51. data/spec/routing/bigbluebutton/servers_routing_spec.rb +1 -9
  52. metadata +9 -12
  53. data/app/views/bigbluebutton/rooms/_rooms.html.erb +0 -37
  54. data/app/views/bigbluebutton/servers/rooms.html.erb +0 -2
  55. data/spec/rails_app/features/support/patches/bigbluebutton_room.rb +0 -9
@@ -13,7 +13,7 @@ describe BigbluebuttonRoom do
13
13
  it { should_not validate_presence_of(:owner_id) }
14
14
  it { should_not validate_presence_of(:owner_type) }
15
15
 
16
- it { should_not validate_presence_of(:server_id) }
16
+ it { should validate_presence_of(:server_id) }
17
17
  it { should validate_presence_of(:meetingid) }
18
18
  it { should validate_presence_of(:voice_bridge) }
19
19
  it { should validate_presence_of(:name) }
@@ -22,10 +22,10 @@ describe BigbluebuttonRoom do
22
22
  it { should be_boolean(:private) }
23
23
  it { should be_boolean(:randomize_meetingid) }
24
24
 
25
- [:name, :server_id, :meetingid, :attendee_password,
26
- :moderator_password, :welcome_msg, :owner, :private, :logout_url,
27
- :dial_number, :voice_bridge, :max_participants, :owner_id,
28
- :owner_type, :randomize_meetingid, :param].
25
+ [:name, :server_id, :meetingid, :attendee_password, :moderator_password,
26
+ :welcome_msg, :owner, :server, :private, :logout_url, :dial_number,
27
+ :voice_bridge, :max_participants, :owner_id, :owner_type,
28
+ :randomize_meetingid, :param].
29
29
  each do |attribute|
30
30
  it { should allow_mass_assignment_of(attribute) }
31
31
  end
@@ -36,6 +36,11 @@ describe BigbluebuttonRoom do
36
36
  it { should validate_uniqueness_of(:voice_bridge) }
37
37
  it { should validate_uniqueness_of(:param) }
38
38
 
39
+ it {
40
+ room = Factory.create(:bigbluebutton_room)
41
+ room.server.should_not be_nil
42
+ }
43
+
39
44
  it { should ensure_length_of(:meetingid).is_at_least(1).is_at_most(100) }
40
45
  it { should ensure_length_of(:name).is_at_least(1).is_at_most(150) }
41
46
  it { should ensure_length_of(:attendee_password).is_at_most(16) }
@@ -45,8 +50,7 @@ describe BigbluebuttonRoom do
45
50
 
46
51
  # attr_accessors
47
52
  [:running, :participant_count, :moderator_count, :attendees,
48
- :has_been_forcibly_ended, :start_time, :end_time,
49
- :external, :server].each do |attr|
53
+ :has_been_forcibly_ended, :start_time, :end_time, :external].each do |attr|
50
54
  it { should respond_to(attr) }
51
55
  it { should respond_to("#{attr}=") }
52
56
  end
@@ -188,26 +192,20 @@ describe BigbluebuttonRoom do
188
192
 
189
193
  it { should respond_to(:fetch_is_running?) }
190
194
 
191
- context "fetches is_running? when not running" do
192
- before {
193
- mocked_api.should_receive(:is_meeting_running?).with(room.meetingid).and_return(false)
194
- room.should_receive(:require_server)
195
- room.server = mocked_server
196
- }
197
- before(:each) { room.fetch_is_running? }
198
- it { room.running.should == false }
199
- it { room.is_running?.should == false }
195
+ it "fetches is_running? when not running" do
196
+ mocked_api.should_receive(:is_meeting_running?).with(room.meetingid).and_return(false)
197
+ room.server = mocked_server
198
+ room.fetch_is_running?
199
+ room.running.should == false
200
+ room.is_running?.should == false
200
201
  end
201
202
 
202
- context "fetches is_running? when running" do
203
- before {
204
- mocked_api.should_receive(:is_meeting_running?).with(room.meetingid).and_return(true)
205
- room.should_receive(:require_server)
206
- room.server = mocked_server
207
- }
208
- before(:each) { room.fetch_is_running? }
209
- it { room.running.should == true }
210
- it { room.is_running?.should == true }
203
+ it "fetches is_running? when running" do
204
+ mocked_api.should_receive(:is_meeting_running?).with(room.meetingid).and_return(true)
205
+ room.server = mocked_server
206
+ room.fetch_is_running?
207
+ room.running.should == true
208
+ room.is_running?.should == true
211
209
  end
212
210
 
213
211
  end
@@ -239,57 +237,53 @@ describe BigbluebuttonRoom do
239
237
 
240
238
  it { should respond_to(:fetch_meeting_info) }
241
239
 
242
- context "fetches meeting info when the meeting is not running" do
243
- before {
244
- mocked_api.should_receive(:get_meeting_info).
245
- with(room.meetingid, room.moderator_password).and_return(hash_info)
246
- room.should_receive(:require_server)
247
- room.server = mocked_server
248
- }
249
- before(:each) { room.fetch_meeting_info }
250
- it { room.running.should == false }
251
- it { room.has_been_forcibly_ended.should == false }
252
- it { room.participant_count.should == 0 }
253
- it { room.moderator_count.should == 0 }
254
- it { room.start_time.should == nil }
255
- it { room.end_time.should == nil }
256
- it { room.attendees.should == [] }
240
+ it "fetches meeting info when the meeting is not running" do
241
+ mocked_api.should_receive(:get_meeting_info).
242
+ with(room.meetingid, room.moderator_password).and_return(hash_info)
243
+ room.server = mocked_server
244
+
245
+ room.fetch_meeting_info
246
+ room.running.should == false
247
+ room.has_been_forcibly_ended.should == false
248
+ room.participant_count.should == 0
249
+ room.moderator_count.should == 0
250
+ room.start_time.should == nil
251
+ room.end_time.should == nil
252
+ room.attendees.should == []
257
253
  end
258
254
 
259
- context "fetches meeting info when the meeting is running" do
260
- before {
261
- mocked_api.should_receive(:get_meeting_info).
262
- with(room.meetingid, room.moderator_password).and_return(hash_info2)
263
- room.should_receive(:require_server)
264
- room.server = mocked_server
265
- }
266
- before(:each) { room.fetch_meeting_info }
267
- it { room.running.should == true }
268
- it { room.has_been_forcibly_ended.should == false }
269
- it { room.participant_count.should == 4 }
270
- it { room.moderator_count.should == 2 }
271
- it { room.start_time.should == DateTime.parse("Wed Apr 06 17:09:57 UTC 2011") }
272
- it { room.end_time.should == nil }
273
- it {
274
- users.each do |att|
275
- attendee = BigbluebuttonAttendee.new
276
- attendee.from_hash(att)
277
- room.attendees.should include(attendee)
278
- end
279
- }
255
+ it "fetches meeting info when the meeting is running" do
256
+ mocked_api.should_receive(:get_meeting_info).
257
+ with(room.meetingid, room.moderator_password).and_return(hash_info2)
258
+ room.server = mocked_server
259
+
260
+ room.fetch_meeting_info
261
+ room.running.should == true
262
+ room.has_been_forcibly_ended.should == false
263
+ room.participant_count.should == 4
264
+ room.moderator_count.should == 2
265
+ room.start_time.should == DateTime.parse("Wed Apr 06 17:09:57 UTC 2011")
266
+ room.end_time.should == nil
267
+
268
+ users.each do |att|
269
+ attendee = BigbluebuttonAttendee.new
270
+ attendee.from_hash(att)
271
+ room.attendees.should include(attendee)
272
+ end
280
273
  end
281
274
 
282
275
  end
283
276
 
284
277
  describe "#send_end" do
278
+
285
279
  it { should respond_to(:send_end) }
286
280
 
287
281
  it "send end_meeting" do
288
282
  mocked_api.should_receive(:end_meeting).with(room.meetingid, room.moderator_password)
289
- room.should_receive(:require_server)
290
283
  room.server = mocked_server
291
284
  room.send_end
292
285
  end
286
+
293
287
  end
294
288
 
295
289
  describe "#send_create" do
@@ -305,7 +299,7 @@ describe BigbluebuttonRoom do
305
299
 
306
300
  it { should respond_to(:send_create) }
307
301
 
308
- context "sends create_meeting" do
302
+ context "send create_meeting" do
309
303
 
310
304
  context "for a stored room" do
311
305
  before do
@@ -315,7 +309,6 @@ describe BigbluebuttonRoom do
315
309
  :voiceBridge => room.voice_bridge)
316
310
  mocked_api.should_receive(:create_meeting).
317
311
  with(room.name, room.meetingid, hash).and_return(hash_create)
318
- room.stub(:select_server).and_return(mocked_server)
319
312
  room.server = mocked_server
320
313
  room.send_create
321
314
  end
@@ -333,7 +326,6 @@ describe BigbluebuttonRoom do
333
326
  :voiceBridge => new_room.voice_bridge)
334
327
  mocked_api.should_receive(:create_meeting).
335
328
  with(new_room.name, new_room.meetingid, hash).and_return(hash_create)
336
- new_room.stub(:select_server).and_return(mocked_server)
337
329
  new_room.server = mocked_server
338
330
  new_room.send_create
339
331
  end
@@ -345,12 +337,13 @@ describe BigbluebuttonRoom do
345
337
  end
346
338
 
347
339
  context "randomizes meetingid" do
348
- let(:fail_hash) { { :returncode => true, :meetingID => "new id", :messageKey => "duplicateWarning" } }
349
- let(:success_hash) { { :returncode => true, :meetingID => "new id", :messageKey => "" } }
340
+ let(:fail_hash) { { :returncode => true, :meetingID => "new id",
341
+ :messageKey => "duplicateWarning" } }
342
+ let(:success_hash) { { :returncode => true, :meetingID => "new id",
343
+ :messageKey => "" } }
350
344
  let(:new_id) { "new id" }
351
345
  before {
352
346
  room.randomize_meetingid = true
353
- room.stub(:select_server).and_return(mocked_server)
354
347
  room.server = mocked_server
355
348
  }
356
349
 
@@ -365,7 +358,7 @@ describe BigbluebuttonRoom do
365
358
  end
366
359
 
367
360
  it "and tries again on error" do
368
- # fails twice and then succeds
361
+ # fails twice and them succeds
369
362
  room.should_receive(:random_meetingid).exactly(3).times.and_return(new_id)
370
363
  hash = hash_including(:moderatorPW => room.moderator_password, :attendeePW => room.attendee_password,
371
364
  :welcome => room.welcome_msg, :dialNumber => room.dial_number,
@@ -399,72 +392,37 @@ describe BigbluebuttonRoom do
399
392
  :voiceBridge => room.voice_bridge)
400
393
  mocked_api.should_receive(:create_meeting).
401
394
  with(room.name, room.meetingid, hash).and_return(hash_create)
402
- room.stub(:select_server).and_return(mocked_server)
403
395
  room.server = mocked_server
404
396
  end
405
397
  it { room.send_create }
406
398
  end
407
399
 
408
- context "selects and requires a server" do
409
- let(:another_server) { Factory.create(:bigbluebutton_server) }
410
-
411
- context "and saves the result" do
412
- before do
413
- room.randomize_meetingid = false # take the shortest path inside #send_create
414
- room.should_receive(:select_server).and_return(another_server)
415
- room.should_receive(:require_server)
416
- room.should_receive(:do_create_meeting)
417
- room.server = mocked_server
418
- room.send_create
419
- end
420
- it { BigbluebuttonRoom.find(room.id).server_id.should == another_server.id }
421
- end
422
-
423
- context "and does not save when is a new record" do
424
- let(:new_room) { Factory.build(:bigbluebutton_room) }
425
- before do
426
- new_room.randomize_meetingid = false # take the shortest path inside #send_create
427
- new_room.should_receive(:select_server).and_return(another_server)
428
- new_room.should_receive(:require_server)
429
- new_room.should_receive(:do_create_meeting).and_return(nil)
430
- new_room.should_not_receive(:save)
431
- new_room.server = mocked_server
432
- new_room.send_create
433
- end
434
- it { new_room.new_record?.should be_true }
435
- end
436
- end
437
-
438
- end # #send_create
400
+ end
439
401
 
440
402
  describe "#join_url" do
441
403
  let(:username) { Forgery(:name).full_name }
442
404
 
443
405
  it { should respond_to(:join_url) }
444
406
 
445
- context do
446
- before { room.should_receive(:require_server) }
447
-
448
- it "with moderator role" do
449
- mocked_api.should_receive(:join_meeting_url).
450
- with(room.meetingid, username, room.moderator_password)
451
- room.server = mocked_server
452
- room.join_url(username, :moderator)
453
- end
407
+ it "with moderator role" do
408
+ mocked_api.should_receive(:join_meeting_url).
409
+ with(room.meetingid, username, room.moderator_password)
410
+ room.server = mocked_server
411
+ room.join_url(username, :moderator)
412
+ end
454
413
 
455
- it "with attendee role" do
456
- mocked_api.should_receive(:join_meeting_url).
457
- with(room.meetingid, username, room.attendee_password)
458
- room.server = mocked_server
459
- room.join_url(username, :attendee)
460
- end
414
+ it "with attendee role" do
415
+ mocked_api.should_receive(:join_meeting_url).
416
+ with(room.meetingid, username, room.attendee_password)
417
+ room.server = mocked_server
418
+ room.join_url(username, :attendee)
419
+ end
461
420
 
462
- it "without a role" do
463
- mocked_api.should_receive(:join_meeting_url).
464
- with(room.meetingid, username, 'pass')
465
- room.server = mocked_server
466
- room.join_url(username, nil, 'pass')
467
- end
421
+ it "without a role" do
422
+ mocked_api.should_receive(:join_meeting_url).
423
+ with(room.meetingid, username, 'pass')
424
+ room.server = mocked_server
425
+ room.join_url(username, nil, 'pass')
468
426
  end
469
427
  end
470
428
 
@@ -590,48 +548,4 @@ describe BigbluebuttonRoom do
590
548
  it { should respond_to(:"full_logout_url=") }
591
549
  end
592
550
 
593
- describe "#require_server" do
594
- let(:room) { Factory.create(:bigbluebutton_room) }
595
- it { should respond_to(:require_server) }
596
-
597
- context "throws exception when the room has no server associated" do
598
- before { room.server = nil }
599
- it {
600
- lambda {
601
- room.send(:require_server)
602
- }.should raise_error(BigbluebuttonRails::ServerRequired)
603
- }
604
- end
605
-
606
- context "does nothing if the room has a server associated" do
607
- before { room.server = Factory.create(:bigbluebutton_server) }
608
- it {
609
- lambda {
610
- room.send(:require_server)
611
- }.should_not raise_error(BigbluebuttonRails::ServerRequired)
612
- }
613
- end
614
- end
615
-
616
- describe "#select_server" do
617
- let(:room) { Factory.create(:bigbluebutton_room, :server => nil) }
618
- it { should respond_to(:select_server) }
619
-
620
- context "selects the server with less rooms" do
621
- before {
622
- BigbluebuttonServer.destroy_all
623
- s1 = Factory.create(:bigbluebutton_server)
624
- @s2 = Factory.create(:bigbluebutton_server)
625
- 3.times{ Factory.create(:bigbluebutton_room, :server => s1) }
626
- 2.times{ Factory.create(:bigbluebutton_room, :server => @s2) }
627
- }
628
- it { room.send(:select_server).should == @s2 }
629
- end
630
-
631
- context "returns nil of there are no servers" do
632
- before(:each) { BigbluebuttonServer.destroy_all }
633
- it { room.send(:select_server).should == nil }
634
- end
635
- end
636
-
637
551
  end
@@ -36,15 +36,15 @@ describe BigbluebuttonServer do
36
36
  server.rooms.should_not be_empty
37
37
  end
38
38
 
39
- it "nullifies associated rooms" do
39
+ it "destroys associated rooms" do
40
40
  server = Factory.create(:bigbluebutton_server)
41
- room = Factory.create(:bigbluebutton_room, :server => server)
41
+ Factory.create(:bigbluebutton_room, :server => server)
42
+ Factory.create(:bigbluebutton_room, :server => server)
42
43
  expect {
43
44
  expect {
44
45
  server.destroy
45
46
  }.to change{ BigbluebuttonServer.count }.by(-1)
46
- }.to change{ BigbluebuttonRoom.count }.by(0)
47
- BigbluebuttonRoom.find(room.id).server_id.should == nil
47
+ }.to change{ BigbluebuttonRoom.count }.by(-2)
48
48
  end
49
49
 
50
50
  it { should ensure_length_of(:name).is_at_least(1).is_at_most(500) }
@@ -2,12 +2,6 @@ Feature: Monitor the active in the webconference servers
2
2
  To check the current status of a server
3
3
  One needs a real-time activity monitor
4
4
 
5
- Scenario: View the activity monitor page
6
- Given an anonymous user
7
- And a real server
8
- When he goes to the server activity monitor page
9
- Then he should see the server activity monitor page
10
-
11
5
  @need-bot
12
6
  Scenario: View the list of meetings running in a server
13
7
  Given an anonymous user
@@ -2,11 +2,6 @@ Feature: Create webconference rooms
2
2
  In order to held webconferences
3
3
  One needs to create and configure webconference rooms
4
4
 
5
- Scenario: Access the page to create a new room
6
- Given an anonymous user
7
- When he goes to the new room page
8
- Then he should see the new room page
9
-
10
5
  Scenario: Register a new BigBlueButton room
11
6
  Given a real server
12
7
  When the user goes to the new room page
@@ -2,18 +2,13 @@ Feature: Create webconference servers
2
2
  In order to held webconferences
3
3
  One needs to create and configure webconference servers
4
4
 
5
- Scenario: Access the page to create a new server
6
- Given an anonymous user
7
- When he goes to the new server page
8
- Then he should see the new server page
9
-
10
- Scenario: Register a new server
5
+ Scenario: Register a new BigBlueButton server
11
6
  Given an anonymous user
12
7
  When he goes to the new server page
13
8
  And registers a new server
14
9
  Then he should see the information about this server
15
10
 
16
- Scenario: Try to register a server with errors
11
+ Scenario: Try to register a BigBlueButton server with errors
17
12
  Given an anonymous user
18
13
  When he goes to the new server page
19
14
  And registers a new server with a wrong URL
@@ -2,13 +2,6 @@ Feature: Edit webconference rooms
2
2
  To change the information of a webconference rooms
3
3
  One needs to be able to edit and update the room
4
4
 
5
- Scenario: Access the page to edit a room
6
- Given an anonymous user
7
- And a real server
8
- And a room in this server
9
- When he goes to the edit room page
10
- Then he should see the edit room page
11
-
12
5
  Scenario: Edit data in a BigBlueButton room
13
6
  Given an anonymous user
14
7
  And a real server
@@ -2,13 +2,7 @@ Feature: Edit webconference servers
2
2
  To change the information of a webconference server
3
3
  One needs to be able to edit and update the server
4
4
 
5
- Scenario: Access the page to edit a server
6
- Given an anonymous user
7
- And a real server
8
- When he goes to the edit server page
9
- Then he should see the edit server page
10
-
11
- Scenario: Edit data in a server
5
+ Scenario: Edit data in a BigBlueButton server
12
6
  Given an anonymous user
13
7
  And a real server
14
8
  When he goes to the edit server page
@@ -17,7 +11,7 @@ Feature: Edit webconference servers
17
11
  Then he should be at the show server URL
18
12
  And the server URL should be "http://test.com/bigbluebutton/api"
19
13
 
20
- Scenario: Try to edit data in a server with incorrect values
14
+ Scenario: Try to edit data in a BigBlueButton server with incorrect values
21
15
  Given an anonymous user
22
16
  And a real server
23
17
  When he goes to the edit server page
@@ -35,7 +35,6 @@ Feature: Join webconference rooms
35
35
  And a private room in this server
36
36
  When the user goes to the join room page
37
37
  Then he should be redirected to the invite room URL
38
- And he should see the invite room page
39
38
 
40
39
  @mechanize
41
40
  Scenario: Joining a private room as a moderator
@@ -3,24 +3,16 @@ Feature: List and show webconference rooms
3
3
  One needs to see the room in a list of rooms
4
4
  and see all the information it has stored
5
5
 
6
- Scenario: View the list of rooms
6
+ Scenario: View the list of BigBlueButton rooms
7
7
  Given an anonymous user
8
8
  And a real server
9
9
  And 3 rooms in this server
10
10
  When he goes to the rooms index page
11
11
  Then he should see all available rooms in the list
12
12
 
13
- Scenario: View all information of a room
13
+ Scenario: View all information of a BigBlueButton room
14
14
  Given an anonymous user
15
15
  And a real server
16
16
  And a room in this server
17
17
  When he goes to the show room page
18
18
  Then he should see all the information available for this room
19
-
20
- Scenario: View the list of rooms for a single server
21
- Given an anonymous user
22
- And a real server
23
- And 3 rooms in this server
24
- And 2 rooms in any other server
25
- When he goes to the server rooms page
26
- Then he should see only the rooms from this server
@@ -4,8 +4,8 @@ When /^(\d+) meetings running in this server$/ do |count|
4
4
  count.to_i.times do |i|
5
5
  room = Factory.create(:bigbluebutton_room, :server => @server)
6
6
  room.send_create
7
- BigBlueButtonBot.new(@server.api, room.meetingid, msalt, 1,
8
- FeaturesConfig.root['timeout_bot_start'])
7
+ BigBlueButtonBot.new(@server.api, room.meetingid, msalt,
8
+ 1, FeaturesConfig.root['timeout_bot_start'])
9
9
  @rooms << room
10
10
  end
11
11
  end
@@ -16,8 +16,8 @@ When /^(\d+) meetings recently ended in this server$/ do |count|
16
16
  count.to_i.times do |i|
17
17
  room = Factory.create(:bigbluebutton_room, :server => @server)
18
18
  room.send_create
19
- BigBlueButtonBot.new(@server.api, room.meetingid, msalt, 1,
20
- FeaturesConfig.root['timeout_bot_start'])
19
+ BigBlueButtonBot.new(@server.api, room.meetingid, msalt,
20
+ 1, FeaturesConfig.root['timeout_bot_start'])
21
21
  BigBlueButtonBot.finalize(room.meetingid)
22
22
  sleep 1
23
23
  @ended_rooms << room
@@ -76,12 +76,12 @@ def check_server_activity_monitor_rooms(rooms)
76
76
  has_content(room.meetingid)
77
77
 
78
78
  method = room.new_record? ? method(:doesnt_have_element) : method(:has_element)
79
- method.call("a", { :href => bigbluebutton_room_path(room) })
80
- method.call("a", { :href => edit_bigbluebutton_room_path(room) })
81
- method.call("a", { :href => bigbluebutton_room_path(room), :"data-method" => :delete })
82
- method.call("a", { :href => join_bigbluebutton_room_path(room) })
83
- method.call("a", { :href => join_mobile_bigbluebutton_room_path(room) })
84
- method.call("a", { :href => end_bigbluebutton_room_path(room) })
79
+ method.call("a", { :href => bigbluebutton_server_room_path(@server, room) })
80
+ method.call("a", { :href => edit_bigbluebutton_server_room_path(@server, room) })
81
+ method.call("a", { :href => bigbluebutton_server_room_path(@server, room), :"data-method" => :delete })
82
+ method.call("a", { :href => join_bigbluebutton_server_room_path(@server, room) })
83
+ method.call("a", { :href => join_mobile_bigbluebutton_server_room_path(@server, room) })
84
+ method.call("a", { :href => end_bigbluebutton_server_room_path(@server, room) })
85
85
 
86
86
  room.fetch_is_running?
87
87
  if room.is_running?
@@ -5,6 +5,7 @@ end
5
5
  When /^(\d+) server(s)?$/i do |count, _|
6
6
  # Note: these servers are not real, it will NOT be possible to make api requests
7
7
  # for a real server use :bigbluebutton_server_integration
8
+ # Use "a real server" whenever possible
8
9
  count.to_i.times do
9
10
  Factory.create(:bigbluebutton_server)
10
11
  end
@@ -40,17 +41,14 @@ end
40
41
  When /(?:|I ) go(es)? to the (.+) page( \(no view check\))?$/i do |_, page_name, not_check|
41
42
  case page_name
42
43
  when /join external room/i
43
- @params = { :meeting => @room.meetingid, :server_id => @server.id }
44
+ @params = { :meeting => @room.meetingid }
44
45
  end
45
46
  visit path_to(page_name, @params)
47
+ check_template(page_name) if not_check.nil?
46
48
  end
47
49
 
48
50
  When /see the (.+) page$/i do |page_name|
49
- opts = {
50
- :room => @room, :server => @server,
51
- :rooms => BigbluebuttonRoom.all, :servers => BigbluebuttonServer.all
52
- }
53
- check_template(page_name, opts)
51
+ check_template(page_name)
54
52
  end
55
53
 
56
54
  When /a user named "(.+)"/i do |username|
@@ -1,6 +1,5 @@
1
1
  When /^registers a new room$/i do
2
2
  attrs = Factory.attributes_for(:bigbluebutton_room, :server => @server)
3
- fill_in("bigbluebutton_room[server_id]", :with => attrs[:server_id])
4
3
  fill_in("bigbluebutton_room[name]", :with => attrs[:name])
5
4
  fill_in("bigbluebutton_room[meetingid]", :with => attrs[:meetingid])
6
5
  check("bigbluebutton_room[randomize_meetingid]") if attrs[:randomize_meetingid]
@@ -1,3 +1,5 @@
1
1
  When /^he should see the QR code and a link to join using a mobile device$/i do
2
- check_template("mobile join", { :room => @room })
2
+ # FIXME this is already being checked in "he goes to the mobile join page"
3
+ # any better ideas?
4
+ check_template("mobile join")
3
5
  end
@@ -1,13 +1,17 @@
1
1
  When /^he should see a form to join the external room$/i do
2
- check_template("join external room")
2
+ within(form_selector(external_bigbluebutton_server_rooms_path(@server), 'post')) do
3
+ has_element("input", { :name => 'meeting', :type => 'hidden', :value => @room.meetingid })
4
+ has_element("input", { :name => 'user[name]', :type => 'text' })
5
+ has_element("input", { :name => 'user[password]', :type => 'password' })
6
+ end
3
7
  end
4
8
 
5
9
  When /^he should see his name in the user name input$/i do
6
10
  case current_url
7
11
  when /\/invite$/ # normal rooms
8
- form = form_selector(join_bigbluebutton_room_path(@room), 'post')
12
+ form = form_selector(join_bigbluebutton_server_room_path(@server, @room), 'post')
9
13
  when /\/external(\?.*)?/ # external rooms
10
- form = form_selector(external_bigbluebutton_rooms_path, 'post')
14
+ form = form_selector(external_bigbluebutton_server_rooms_path(@server), 'post')
11
15
  end
12
16
  within(form) do
13
17
  has_element("input", { :name => 'user[name]', :type => 'text', :value => @user.name })
@@ -1,18 +1,11 @@
1
1
  When /^he should see all available rooms in the list$/i do
2
+ # FIXME this is already being checked in "he goes to the rooms index page"
3
+ # any better ideas?
2
4
  check_template("rooms index")
3
5
  end
4
6
 
5
7
  When /^he should see all the information available for this room$/i do
6
- check_template("show room", { :room => @room })
7
- end
8
-
9
- When /^(\d+) room(s)? in any other server$/i do |count, _|
10
- any_other_server = Factory.create(:bigbluebutton_server)
11
- count.to_i.times do
12
- Factory.create(:bigbluebutton_room, :server => any_other_server)
13
- end
14
- end
15
-
16
- When /^he should see only the rooms from this server$/i do
17
- check_template("server rooms", { :rooms => @server.rooms })
8
+ # FIXME this is already being checked in "he goes to the show room page"
9
+ # any better ideas?
10
+ check_template("show room")
18
11
  end
@@ -1,7 +1,11 @@
1
1
  When /^he should see all available servers in the list$/i do
2
+ # FIXME this is already being checked in "he goes to the servers index page"
3
+ # any better ideas?
2
4
  check_template("servers index")
3
5
  end
4
6
 
5
7
  When /^he should see all the information available for this server$/i do
6
- check_template("show server", { :server => @server })
8
+ # FIXME this is already being checked in "he goes to the show server page"
9
+ # any better ideas?
10
+ check_template("show server")
7
11
  end