bigbluebutton_rails 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ log
7
7
  spec/rails_app/features/config.yml
8
8
  coverage/
9
9
  rails_best_practices_output.html
10
+ bot.log
data/.rvmrc CHANGED
@@ -2,5 +2,5 @@
2
2
  if [ -e '.rvmrc_custom' ]; then
3
3
  source .rvmrc_custom;
4
4
  else
5
- rvm --create use 1.9.2@bigbluebutton_rails;
5
+ rvm --create use 1.9.3-p194@bigbluebutton_rails;
6
6
  fi
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ == 1.2.0
2
+
3
+ * Updated ruby to 1.9.3-194.
4
+ * Support to BigBlueButton 0.4 rc1.
5
+ * Updated bigbluebutton-api-ruby to 1.1.0.
6
+
1
7
  == 1.1.0
2
8
 
3
9
  * Rooms are now decoupled from servers:
data/Gemfile.lock CHANGED
@@ -7,8 +7,8 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- bigbluebutton_rails (1.1.0)
11
- bigbluebutton-api-ruby (~> 0.1.0)
10
+ bigbluebutton_rails (1.2.0)
11
+ bigbluebutton-api-ruby (~> 1.1.0)
12
12
  rails (>= 3.0.0)
13
13
 
14
14
  GEM
@@ -43,7 +43,7 @@ GEM
43
43
  activesupport (3.0.11)
44
44
  addressable (2.2.6)
45
45
  arel (2.0.10)
46
- bigbluebutton-api-ruby (0.1.0)
46
+ bigbluebutton-api-ruby (1.1.0)
47
47
  xml-simple (>= 1.1.1)
48
48
  builder (2.1.2)
49
49
  capybara (1.1.2)
@@ -57,7 +57,7 @@ GEM
57
57
  capybara (~> 1.1.0)
58
58
  mechanize (~> 2.0.0)
59
59
  capybara-webkit (0.7.2)
60
- capybara (< 1.2, >= 1.0.0)
60
+ capybara (>= 1.0.0, < 1.2)
61
61
  childprocess (0.2.3)
62
62
  ffi (~> 1.0.6)
63
63
  colored (1.2)
@@ -80,7 +80,7 @@ GEM
80
80
  ffi (1.0.11)
81
81
  forgery (0.5.0)
82
82
  generator_spec (0.8.4)
83
- rails (< 4.0, >= 3.0)
83
+ rails (>= 3.0, < 4.0)
84
84
  rspec-rails
85
85
  gherkin (2.7.1)
86
86
  json (>= 1.4.6)
@@ -94,10 +94,10 @@ GEM
94
94
  mime-types (~> 1.16)
95
95
  treetop (~> 1.4.8)
96
96
  mechanize (2.0.1)
97
- net-http-digest_auth (>= 1.1.1, ~> 1.1)
97
+ net-http-digest_auth (~> 1.1, >= 1.1.1)
98
98
  net-http-persistent (~> 1.8)
99
99
  nokogiri (~> 1.4)
100
- webrobots (>= 0.0.9, ~> 0.0)
100
+ webrobots (~> 0.0, >= 0.0.9)
101
101
  mime-types (1.17.2)
102
102
  multi_json (1.0.4)
103
103
  net-http-digest_auth (1.2)
@@ -113,16 +113,16 @@ class Bigbluebutton::RoomsController < ApplicationController
113
113
 
114
114
  # Used by logged users to join public rooms.
115
115
  def join
116
- role = bigbluebutton_role(@room)
117
- if role.nil?
116
+ @user_role = bigbluebutton_role(@room)
117
+ if @user_role.nil?
118
118
  raise BigbluebuttonRails::RoomAccessDenied.new
119
119
 
120
120
  # anonymous users or users with the role :password join through #invite
121
- elsif bigbluebutton_user.nil? or role == :password
122
- redirect_to :action => :invite
121
+ elsif bigbluebutton_user.nil? or @user_role == :password
122
+ redirect_to :action => :invite, :mobile => params[:mobile]
123
123
 
124
124
  else
125
- join_internal(bigbluebutton_user.name, role, :join)
125
+ join_internal(bigbluebutton_user.name, @user_role, :join)
126
126
  end
127
127
  end
128
128
 
@@ -130,14 +130,9 @@ class Bigbluebutton::RoomsController < ApplicationController
130
130
  def invite
131
131
  respond_with @room do |format|
132
132
 
133
- role = bigbluebutton_role(@room)
134
- if role.nil?
133
+ @user_role = bigbluebutton_role(@room)
134
+ if @user_role.nil?
135
135
  raise BigbluebuttonRails::RoomAccessDenied.new
136
-
137
- # if there's already a logged user with a role in the room, join through #join
138
- elsif !bigbluebutton_user.nil? and role != :password
139
- format.html { redirect_to :action => :join }
140
-
141
136
  else
142
137
  format.html
143
138
  end
@@ -156,15 +151,15 @@ class Bigbluebutton::RoomsController < ApplicationController
156
151
  end
157
152
 
158
153
  name = bigbluebutton_user.nil? ? params[:user][:name] : bigbluebutton_user.name
159
- role = bigbluebutton_role(@room)
160
- if role.nil?
154
+ @user_role = bigbluebutton_role(@room)
155
+ if @user_role.nil?
161
156
  raise BigbluebuttonRails::RoomAccessDenied.new
162
- elsif role == :password
163
- role = @room.user_role(params[:user])
157
+ elsif @user_role == :password
158
+ @user_role = @room.user_role(params[:user])
164
159
  end
165
160
 
166
- unless role.nil? or name.nil? or name.empty?
167
- join_internal(name, role, :invite)
161
+ unless @user_role.nil? or name.nil? or name.empty?
162
+ join_internal(name, @user_role, :invite)
168
163
  else
169
164
  flash[:error] = t('bigbluebutton_rails.rooms.errors.auth.failure')
170
165
  render :invite, :status => :unauthorized
@@ -7,6 +7,11 @@ module BigbluebuttonRailsHelper
7
7
  "https://chart.googleapis.com/chart?cht=qr&chs=#{size}&chl=#{content}&choe=UTF-8"
8
8
  end
9
9
 
10
- end
11
-
10
+ # TODO: improve it, showing all flashes
11
+ def bbb_rails_error_explanation
12
+ if flash.has_key?(:error) and !flash[:error].blank?
13
+ content_tag(:div, flash[:error], { :id => "error_explanation" })
14
+ end
15
+ end
12
16
 
17
+ end
@@ -302,13 +302,24 @@ class BigbluebuttonRoom < ActiveRecord::Base
302
302
  end
303
303
 
304
304
  def do_create_meeting
305
- opts = { :moderatorPW => self.moderator_password, :attendeePW => self.attendee_password,
306
- :welcome => self.welcome_msg, :dialNumber => self.dial_number,
305
+ msg = (self.welcome_msg.nil? or self.welcome_msg.empty?) ? default_welcome_message : self.welcome_msg
306
+ opts = {
307
+ :moderatorPW => self.moderator_password, :attendeePW => self.attendee_password,
308
+ :welcome => msg, :dialNumber => self.dial_number,
307
309
  :logoutURL => self.full_logout_url || self.logout_url,
308
- :maxParticipants => self.max_participants, :voiceBridge => self.voice_bridge }
310
+ :maxParticipants => self.max_participants, :voiceBridge => self.voice_bridge
311
+ }
309
312
  self.server.api.create_meeting(self.name, self.meetingid, opts)
310
313
  end
311
314
 
315
+ # Returns the default welcome message to be shown in a conference in case
316
+ # there's no message set in this room.
317
+ # Can be used to easily set a default message format for all rooms.
318
+ def default_welcome_message
319
+ I18n.t('bigbluebutton_rails.rooms.default_welcome_msg',
320
+ :name => self.name, :voice_number => self.voice_bridge)
321
+ end
322
+
312
323
  # if :param wasn't set, sets it as :name downcase and parameterized
313
324
  def set_param
314
325
  if self.param.blank?
@@ -28,27 +28,39 @@ $(document).ready(function(){
28
28
 
29
29
  <h1>Invite to the meeting <%= @room.name %></h1>
30
30
 
31
- <div id="error_explanation"><%= flash[:error] %></div>
31
+ <%= bbb_rails_error_explanation %>
32
32
 
33
33
  <p>Meeting status: <span id="meeting_status">-</span> (<a href="javascript:ajax_request();">refresh</a>)</p>
34
- <p><%= @room.name %> requires a name and/or password to join:</p>
35
34
 
36
- <%= form_tag join_bigbluebutton_room_path(@room) do %>
35
+ <div class="bbbrails_invite_device_type">
36
+ <% if params[:mobile] %>
37
+ In this page you can join the conference from a <b>mobile device</b>.
38
+ To join from a desktop <%= link_to "click here", invite_bigbluebutton_room_path(@room) %>.
39
+ <% else %>
40
+ In this page you can join the conference from a <b>desktop</b>.
41
+ To join from a mobile device <%= link_to "click here", invite_bigbluebutton_room_path(@room, :mobile => true) %>.
42
+ <% end %>
43
+ </div>
44
+
45
+ <p><%= @room.name %> requires a name and/or password to join:</p>
46
+ <%= form_tag join_bigbluebutton_room_path(@room, :mobile => params[:mobile]) do %>
37
47
 
38
48
  <div class="field">
39
49
  <label for="user_name">Name:</label><br />
40
50
  <% if bigbluebutton_user.nil? %>
41
51
  <%= text_field_tag "user[name]", "" %>
42
52
  <% else %>
43
- <%= text_field_tag "user[name]", bigbluebutton_user.name %>
53
+ <%= text_field_tag "user[name]", bigbluebutton_user.name, :readonly => true %>
44
54
  <% end %>
45
55
  </div>
46
56
  <div class="field">
47
57
  <label for="user_password">Password:</label><br />
48
- <% if @room.private %>
49
- <%= password_field_tag "user[password]", "" %>
58
+ <% if @user_role == :attendee %>
59
+ <%= password_field_tag "user[password]", @room.attendee_password, :readonly => true %>
60
+ <% elsif @user_role == :moderator %>
61
+ <%= password_field_tag "user[password]", @room.moderator_password, :readonly => true %>
50
62
  <% else %>
51
- <%= password_field_tag "user[password]", @room.attendee_password %>
63
+ <%= password_field_tag "user[password]", "" %>
52
64
  <% end %>
53
65
  </div>
54
66
 
@@ -16,5 +16,5 @@ Gem::Specification.new do |s|
16
16
  s.require_paths = ["lib"]
17
17
 
18
18
  s.add_dependency("rails", ">= 3.0.0")
19
- s.add_dependency("bigbluebutton-api-ruby", "~> 0.1.0")
19
+ s.add_dependency("bigbluebutton-api-ruby", "~> 1.1.0")
20
20
  end
@@ -11,6 +11,7 @@ en:
11
11
  param_format: 'you can only use letters, numbers and the symbols "-" or "_" (not at the begin or end)'
12
12
  url_format: 'should use the pattern http://<server>/bigbluebutton/api'
13
13
  rooms:
14
+ default_welcome_msg: "Welcome to the conference <b>%{name}!</b><br/><br/>To join the audio conference from a SIP phone, dial %{voice_number}.<br/><br/>If you need help using the conference client <u><a href=\"http://www.bigbluebutton.org/videos/\">check out these videos</a></u>."
14
15
  notice:
15
16
  create:
16
17
  success: "Your room was successfully created."
@@ -1,3 +1,3 @@
1
1
  module BigbluebuttonRails
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
@@ -136,3 +136,13 @@
136
136
  margin-right: 10px;
137
137
  clear: both;
138
138
  }
139
+
140
+ /*
141
+ * Used in bigbluebutton_rooms/invite
142
+ */
143
+
144
+ .bbbrails_invite_device_type {
145
+ background: #f6f6f6;
146
+ border: 1px solid #ddd;
147
+ padding: 5px;
148
+ }
@@ -238,12 +238,11 @@ describe Bigbluebutton::RoomsController do
238
238
 
239
239
  context "for an anonymous user" do
240
240
  before { controller.stub(:bigbluebutton_user) { nil } }
241
- before { controller.stub(:bigbluebutton_role) { :moderator } }
241
+ before { controller.stub(:bigbluebutton_role) { :password } }
242
242
  before(:each) { get :join, :id => room.to_param }
243
- it {
244
- should respond_with(:redirect)
245
- should redirect_to(invite_bigbluebutton_room_path(room))
246
- }
243
+ it { should assign_to(:user_role).with(:password) }
244
+ it { should respond_with(:redirect) }
245
+ it { should redirect_to(invite_bigbluebutton_room_path(room)) }
247
246
  end
248
247
 
249
248
  context "when the user's role" do
@@ -253,6 +252,7 @@ describe Bigbluebutton::RoomsController do
253
252
  before { controller.stub(:bigbluebutton_role) { :password } }
254
253
  before(:each) { get :join, :id => room.to_param }
255
254
  it { should respond_with(:redirect) }
255
+ it { should assign_to(:user_role).with(:password) }
256
256
  it { should redirect_to(invite_bigbluebutton_room_path(room)) }
257
257
  end
258
258
 
@@ -316,68 +316,36 @@ describe Bigbluebutton::RoomsController do
316
316
  describe "#invite" do
317
317
  before { mock_server_and_api }
318
318
  let(:user) { Factory.build(:user) }
319
+ before { controller.stub(:bigbluebutton_user).and_return(user) }
319
320
 
320
- context "for an anonymous user" do
321
- before { controller.stub(:bigbluebutton_user).and_return(nil) }
321
+ context "when the user has a role defined" do
322
+ before { controller.stub(:bigbluebutton_role).and_return(:attendee) }
323
+ before(:each) { get :invite, :id => room.to_param }
324
+ it { should respond_with(:success) }
325
+ it { should render_template(:invite) }
326
+ it { should assign_to(:room).with(room) }
327
+ it { should assign_to(:user_role).with(:attendee) }
328
+ end
322
329
 
323
- context "with a role defined" do
324
- before { controller.stub(:bigbluebutton_role).and_return(:attendee) }
330
+ context "when the user's role" do
331
+ context "should be defined with a password" do
332
+ before { controller.stub(:bigbluebutton_role) { :password } }
325
333
  before(:each) { get :invite, :id => room.to_param }
326
334
  it { should respond_with(:success) }
327
335
  it { should render_template(:invite) }
328
336
  it { should assign_to(:room).with(room) }
337
+ it { should assign_to(:user_role).with(:password) }
329
338
  end
330
339
 
331
- context "when the user's role" do
332
- context "should be defined with a password" do
333
- before { controller.stub(:bigbluebutton_role) { :password } }
334
- before(:each) { get :invite, :id => room.to_param }
335
- it { should respond_with(:success) }
336
- it { should render_template(:invite) }
337
- it { should assign_to(:room).with(room) }
338
- end
339
-
340
- context "is undefined, the access should be blocked" do
341
- before { controller.stub(:bigbluebutton_role) { nil } }
342
- it {
343
- lambda {
344
- get :invite, :id => room.to_param
345
- }.should raise_error(BigbluebuttonRails::RoomAccessDenied)
346
- }
347
- end
348
- end
349
- end
350
-
351
- context "for a logged user" do
352
- before { controller.stub(:bigbluebutton_user).and_return(user) }
353
-
354
- context "with a role defined" do
355
- before { controller.stub(:bigbluebutton_role).and_return(:attendee) }
356
- before(:each) { get :invite, :id => room.to_param }
357
- it { should respond_with(:redirect) }
358
- it { should redirect_to(join_bigbluebutton_room_path(room)) }
359
- end
360
-
361
- context "when the user's role" do
362
- context "should be defined with a password" do
363
- before { controller.stub(:bigbluebutton_role) { :password } }
364
- before(:each) { get :invite, :id => room.to_param }
365
- it { should respond_with(:success) }
366
- it { should render_template(:invite) }
367
- it { should assign_to(:room).with(room) }
368
- end
369
-
370
- context "is undefined, the access should be blocked" do
371
- before { controller.stub(:bigbluebutton_role) { nil } }
372
- it {
373
- lambda {
374
- get :invite, :id => room.to_param
375
- }.should raise_error(BigbluebuttonRails::RoomAccessDenied)
376
- }
377
- end
340
+ context "is undefined, the access should be blocked" do
341
+ before { controller.stub(:bigbluebutton_role) { nil } }
342
+ it {
343
+ lambda {
344
+ get :invite, :id => room.to_param
345
+ }.should raise_error(BigbluebuttonRails::RoomAccessDenied)
346
+ }
378
347
  end
379
348
  end
380
-
381
349
  end
382
350
 
383
351
  describe "#auth" do
@@ -441,7 +409,7 @@ describe Bigbluebutton::RoomsController do
441
409
  should redirect_to("http://test.com/attendee/join")
442
410
  end
443
411
 
444
- it "use bigbluebutton_role when the return is diferent of password" do
412
+ it "uses bigbluebutton_role when the return is not :password" do
445
413
  controller.stub(:bigbluebutton_role) { :attendee }
446
414
  hash = { :name => "Elftor", :password => nil }
447
415
  mocked_api.should_receive(:is_meeting_running?).and_return(true)
@@ -451,6 +419,7 @@ describe Bigbluebutton::RoomsController do
451
419
  post :auth, :id => room.to_param, :user => hash
452
420
  should respond_with(:redirect)
453
421
  should redirect_to("http://test.com/attendee/join")
422
+ should assign_to(:user_role).with(:attendee)
454
423
  end
455
424
 
456
425
  context "validates user input and shows error" do
@@ -461,6 +430,7 @@ describe Bigbluebutton::RoomsController do
461
430
  let(:user_hash) { { :password => room.moderator_password } }
462
431
  it { should respond_with(:unauthorized) }
463
432
  it { should assign_to(:room).with(room) }
433
+ it { should assign_to(:user_role).with(:moderator) }
464
434
  it { should render_template(:invite) }
465
435
  it { should set_the_flash.to(I18n.t('bigbluebutton_rails.rooms.errors.auth.failure')) }
466
436
  end
@@ -469,6 +439,7 @@ describe Bigbluebutton::RoomsController do
469
439
  let(:user_hash) { { :password => room.moderator_password, :name => "" } }
470
440
  it { should respond_with(:unauthorized) }
471
441
  it { should assign_to(:room).with(room) }
442
+ it { should assign_to(:user_role).with(:moderator) }
472
443
  it { should render_template(:invite) }
473
444
  it { should set_the_flash.to(I18n.t('bigbluebutton_rails.rooms.errors.auth.failure')) }
474
445
  end
@@ -476,6 +447,7 @@ describe Bigbluebutton::RoomsController do
476
447
  context "when the password is wrong" do
477
448
  let(:user_hash) { { :name => "Elftor", :password => nil } }
478
449
  it { should respond_with(:unauthorized) }
450
+ it { should assign_to(:user_role).with(nil) }
479
451
  it { should assign_to(:room).with(room) }
480
452
  it { should render_template(:invite) }
481
453
  it { should set_the_flash.to(I18n.t('bigbluebutton_rails.rooms.errors.auth.failure')) }
@@ -1,14 +1,16 @@
1
- Factory.define :bigbluebutton_room do |r|
2
- # meetingid with a random factor to avoid duplicated ids in consecutive test runs
3
- r.sequence(:meetingid) { |n| "meeting-#{n}-" + SecureRandom.hex(4) }
1
+ FactoryGirl.define do
2
+ factory :bigbluebutton_room do |r|
3
+ # meetingid with a random factor to avoid duplicated ids in consecutive test runs
4
+ r.sequence(:meetingid) { |n| "meeting-#{n}-" + SecureRandom.hex(4) }
4
5
 
5
- r.association :server, :factory => :bigbluebutton_server
6
- r.sequence(:name) { |n| "Name#{n}" }
7
- r.attendee_password { Forgery(:basic).password :at_least => 10, :at_most => 16 }
8
- r.moderator_password { Forgery(:basic).password :at_least => 10, :at_most => 16 }
9
- r.welcome_msg { Forgery(:lorem_ipsum).sentences(2) }
10
- r.private false
11
- r.randomize_meetingid false
12
- r.sequence(:param) { |n| "meeting-#{n}" }
13
- r.external false
6
+ r.association :server, :factory => :bigbluebutton_server
7
+ r.sequence(:name) { |n| "Name#{n}" }
8
+ r.attendee_password { Forgery(:basic).password :at_least => 10, :at_most => 16 }
9
+ r.moderator_password { Forgery(:basic).password :at_least => 10, :at_most => 16 }
10
+ r.welcome_msg { Forgery(:lorem_ipsum).sentences(2) }
11
+ r.private false
12
+ r.randomize_meetingid false
13
+ r.sequence(:param) { |n| "meeting-#{n}" }
14
+ r.external false
15
+ end
14
16
  end
@@ -1,7 +1,9 @@
1
- Factory.define :bigbluebutton_server do |s|
2
- s.sequence(:name) { |n| "Server #{n}" }
3
- s.sequence(:url) { |n| "http://bigbluebutton#{n}.test.com/bigbluebutton/api" }
4
- s.salt { Forgery(:basic).password :at_least => 30, :at_most => 40 }
5
- s.version '0.7'
6
- s.sequence(:param) { |n| "server-#{n}" }
1
+ FactoryGirl.define do
2
+ factory :bigbluebutton_server do |s|
3
+ s.sequence(:name) { |n| "Server #{n}" }
4
+ s.sequence(:url) { |n| "http://bigbluebutton#{n}.test.com/bigbluebutton/api" }
5
+ s.salt { Forgery(:basic).password :at_least => 30, :at_most => 40 }
6
+ s.version '0.7'
7
+ s.sequence(:param) { |n| "server-#{n}" }
8
+ end
7
9
  end
@@ -1,3 +1,5 @@
1
- Factory.define :user do |u|
2
- u.name { Forgery(:name).full_name }
1
+ FactoryGirl.define do
2
+ factory :user do |u|
3
+ u.name { Forgery(:name).full_name }
4
+ end
3
5
  end
@@ -302,9 +302,29 @@ describe BigbluebuttonRoom do
302
302
  :hasBeenForciblyEnded => "false", :messageKey => {}, :message => {}
303
303
  }
304
304
  }
305
+ before { room.update_attributes(:welcome_msg => "Anything") }
305
306
 
306
307
  it { should respond_to(:send_create) }
307
308
 
309
+ context "calls #default_welcome_msg if welcome_msg is" do
310
+ before do
311
+ room.should_receive(:default_welcome_message).and_return("Hi!")
312
+ mocked_api.should_receive(:create_meeting).
313
+ with(anything, anything, hash_including(:welcome => "Hi!"))
314
+ room.stub(:select_server).and_return(mocked_server)
315
+ room.server = mocked_server
316
+ end
317
+
318
+ context "nil" do
319
+ before { room.welcome_msg = nil }
320
+ it { room.send_create }
321
+ end
322
+ context "empty" do
323
+ before { room.welcome_msg = "" }
324
+ it { room.send_create }
325
+ end
326
+ end
327
+
308
328
  context "sends create_meeting" do
309
329
 
310
330
  context "for a stored room" do
@@ -34,8 +34,6 @@ Feature: Monitor the active in the webconference servers
34
34
  When he goes to the server activity monitor page
35
35
  Then he should see the external room in the list
36
36
 
37
- # Note: This will only work for bbb servers with removeMeetingWhenEnded=false
38
- # See: http://code.google.com/p/bigbluebutton/issues/detail?id=980
39
37
  @need-bot
40
38
  Scenario: Contains a link to partially refresh the meeting list
41
39
  Given an anonymous user
@@ -46,8 +44,6 @@ Feature: Monitor the active in the webconference servers
46
44
  And he clicks in the link to update the meeting list
47
45
  Then he should see one meeting running and the other meeting not running
48
46
 
49
- # Note: This will only work for bbb servers with removeMeetingWhenEnded=false
50
- # Also defaultMeetingExpireDuration should be >= 2
51
47
  @need-bot @webkit
52
48
  Scenario: Partially refresh the meeting list periodically
53
49
  Given an anonymous user
@@ -10,8 +10,8 @@ Feature: Join webconference rooms
10
10
  # :moderator
11
11
  # end
12
12
 
13
- # First we check the behaviour of BigbluebuttonRoom#join and the redirects to
14
- # BigbluebuttonRoom#invite
13
+ # First the scenarios for BigbluebuttonRoom#join (and the redirects to
14
+ # BigbluebuttonRoom#invite)
15
15
 
16
16
  @mechanize
17
17
  Scenario: Joining a public room
@@ -21,14 +21,6 @@ Feature: Join webconference rooms
21
21
  When the user goes to the join room page
22
22
  Then he should join the conference room
23
23
 
24
- Scenario: Joining a public room as an anonymous user
25
- Given an anonymous user
26
- And a real server
27
- And a public room in this server
28
- When the user goes to the join room page
29
- Then he should be at the invite room URL
30
- And the password field was pre-filled with the attendee password
31
-
32
24
  Scenario: Joining a private room requires a password
33
25
  Given a user named "test user"
34
26
  And a real server
@@ -96,19 +88,62 @@ Feature: Join webconference rooms
96
88
  Then he should see his name in the user name input
97
89
 
98
90
 
99
- # For the BigbluebuttonRoom#invite action we only check that it can be used by logged
100
- # or anonymous users. Other cases were already tested above
91
+ # Scenarios for BigbluebuttonRoom#invite
101
92
 
102
- @mechanize
103
- Scenario: A logged user may join the meeting through the invite page
93
+ # The pre-filling depends on the role of the user, that's defined
94
+ # by bigbluebutton_role(), see the comment on the top of this file.
95
+
96
+ Scenario: The invite view shows a link to join from a mobile device when joining from a desktop
104
97
  Given a user named "test user"
105
98
  And a real server
106
99
  And a public room in this server
100
+ When the user goes to the invite room page
101
+ Then he should see a link to join the conference from a mobile device
102
+
103
+ # Test the invite view with a user logged
104
+
105
+ Scenario: The invite page is pre-filled with the user name and moderator password
106
+ Given a user named "test user"
107
+ And a real server
108
+ # Public room = user is a moderator
109
+ And a public room in this server
110
+ When the user goes to the invite room page (no view check)
111
+ Then he should be at the invite room URL
112
+ And the read-only name field was pre-filled with "test user"
113
+ And the read-only password field was pre-filled with the moderator password
114
+
115
+ Scenario: The invite page is pre-filled with the user name only
116
+ Given a user named "test user"
117
+ And a real server
118
+ # Private room = ask for a password
119
+ And a private room in this server
107
120
  When the user goes to the invite room page (no view check)
121
+ Then the read-only name field was pre-filled with "test user"
122
+ And the password field was NOT pre-filled
123
+
124
+ # Test the invite view without a user logged
125
+
126
+ Scenario: The invite page is not pre-filled when there's no user logged
127
+ Given an anonymous user
128
+ And a real server
129
+ And a public room in this server
130
+ When the user goes to the invite room page
131
+ Then the name field was NOT pre-filled
132
+ And the password field was NOT pre-filled
133
+
134
+ # Test if the user can actually join the conference
135
+
136
+ @mechanize
137
+ Scenario: A logged user may join the meeting using the invite page
138
+ Given a user named "test user"
139
+ And a real server
140
+ And a public room in this server
141
+ When the user goes to the invite room page
142
+ And clicks in the button "Submit"
108
143
  Then he should join the conference room
109
144
 
110
145
  @mechanize
111
- Scenario: An anonymous user may join the meeting through the invite page
146
+ Scenario: An anonymous user may join the meeting using the invite page
112
147
  Given an anonymous user
113
148
  And a real server
114
149
  And a public room in this server
@@ -116,3 +151,29 @@ Feature: Join webconference rooms
116
151
  And enters his name and the moderator password
117
152
  And clicks in the button "Submit"
118
153
  Then he should join the conference room
154
+
155
+ # Tests when the user is accessing from a mobile client
156
+
157
+ Scenario: Accessing from a mobile device the invite form should point to the join with mobile=true
158
+ Given a user named "test user"
159
+ And a real server
160
+ And a public room in this server
161
+ When the user goes to the invite room with mobile page
162
+ Then the action in the form should point to the mobile join
163
+
164
+ @mechanize
165
+ Scenario: Accessing from a mobile device the user should be redirected to the url
166
+ Given a user named "test user"
167
+ And a real server
168
+ And a public room in this server
169
+ When the user goes to the invite room with mobile page
170
+ And enters his name and the moderator password
171
+ And clicks in the button to join the conference from a mobile device
172
+ Then he should be redirected to the conference using the "bigbluebutton://" protocol
173
+
174
+ Scenario: The invite view shows a link to join from a desktop when joining from a mobile
175
+ Given a user named "test user"
176
+ And a real server
177
+ And a public room in this server
178
+ When the user goes to the invite room with mobile page
179
+ Then he should see a link to join the conference from a desktop
@@ -53,6 +53,9 @@ When /^he should see one meeting running and the other meeting not running$/ do
53
53
  @rooms.last.fetch_is_running?
54
54
  @rooms.last.is_running?.should be_true
55
55
 
56
+ # the ended meeting won't appear in the list in BBB 0.8
57
+ @rooms.delete(@rooms.first) if @server.version >= "0.8"
58
+
56
59
  check_server_activity_monitor_rooms(@rooms)
57
60
  end
58
61
 
@@ -40,6 +40,44 @@ When /^enters only the user name$/ do
40
40
  fill_in("user[name]", :with => name)
41
41
  end
42
42
 
43
- When /^the password field was pre-filled with the attendee password$/ do
44
- has_element("input", { :name => 'user[password]', :type => 'password', :value => @room.attendee_password })
43
+ When /^the read-only password field was pre-filled with the moderator password$/ do
44
+ has_element("input", { :name => 'user[password]', :type => 'password', :value => @room.moderator_password, :readonly => 'readonly' })
45
+ end
46
+
47
+ When /^the password field was not pre-filled$/i do
48
+ has_element("input", { :name => 'user[password]', :type => 'password', :value => '' })
49
+ end
50
+
51
+ When /^the read-only name field was pre-filled with "(.+)"$/ do |name|
52
+ has_element("input", { :name => 'user[name]', :type => 'text', :value => name, :readonly => 'readonly' })
53
+ end
54
+
55
+ When /^the name field was not pre-filled$/i do
56
+ has_element("input", { :name => 'user[name]', :type => 'text', :value => ''})
57
+ end
58
+
59
+ When /^the action in the form should point to the mobile join$/i do
60
+ action = join_bigbluebutton_room_path(@room, :mobile => true)
61
+ has_element("form", { :action => action, :method => 'post' })
62
+ end
63
+
64
+ When /^he should see a link to join the conference from a desktop$/i do
65
+ has_element("a", { :href => invite_bigbluebutton_room_path(@room) })
66
+ end
67
+
68
+ When /^he should see a link to join the conference from a mobile device$/i do
69
+ has_element("a", { :href => invite_bigbluebutton_room_path(@room, :mobile => true) })
70
+ end
71
+
72
+ # Joining a conference with mobile=true will redirect the user to a url
73
+ # using the protocol "bigbluebutton://" and Mechanize will throw an exception
74
+ # because it doesn't know the protocol. So we check the url using this exception.
75
+ When /^clicks in the button to join the conference from a mobile device$/i do
76
+ begin
77
+ click_button("Submit")
78
+ rescue Exception => @exception
79
+ end
80
+ end
81
+ When /^he should be redirected to the conference using the "bigbluebutton:\/\/" protocol$/i do
82
+ @exception.message.should match(/bigbluebutton:\/\//)
45
83
  end
@@ -1,5 +1,7 @@
1
- Factory.define :bigbluebutton_server_integration, :parent => :bigbluebutton_server do |s|
2
- s.url { FeaturesConfig.server["url"] }
3
- s.salt { FeaturesConfig.server["salt"] }
4
- s.version { FeaturesConfig.server["version"] }
1
+ FactoryGirl.define do
2
+ factory :bigbluebutton_server_integration, :parent => :bigbluebutton_server do |s|
3
+ s.url { FeaturesConfig.server["url"] }
4
+ s.salt { FeaturesConfig.server["salt"] }
5
+ s.version { FeaturesConfig.server["version"] }
6
+ end
5
7
  end
@@ -5,9 +5,7 @@ module NavigationHelpers
5
5
  #
6
6
  # step definition in web_steps.rb
7
7
  #
8
- def path_to(page_name, params=nil)
9
- params = "?" + params.map{ |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join("&") if params
10
-
8
+ def path_to(page_name, params={})
11
9
  case page_name
12
10
 
13
11
  when /^home\s?$/
@@ -40,8 +38,12 @@ module NavigationHelpers
40
38
  p = bigbluebutton_room_path(@room)
41
39
  when /join room/i
42
40
  p = join_bigbluebutton_room_path(@room)
43
- when /invite room/i
41
+ when /invite room$/i
42
+ p = invite_bigbluebutton_room_path(@room)
43
+ when /invite room with mobile$/i
44
44
  p = invite_bigbluebutton_room_path(@room)
45
+ params = {} if params.nil?
46
+ params[:mobile] = true
45
47
  when /mobile join/i
46
48
  p = join_mobile_bigbluebutton_room_path(@room)
47
49
 
@@ -56,7 +58,10 @@ module NavigationHelpers
56
58
  end
57
59
  end
58
60
 
59
- p += params if params
61
+ unless params.nil? or params.empty?
62
+ params = "?" + params.map{ |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join("&")
63
+ p += params
64
+ end
60
65
  p
61
66
  end
62
67
  end
@@ -136,3 +136,13 @@
136
136
  margin-right: 10px;
137
137
  clear: both;
138
138
  }
139
+
140
+ /*
141
+ * Used in bigbluebutton_rooms/invite
142
+ */
143
+
144
+ .bbbrails_invite_device_type {
145
+ background: #f6f6f6;
146
+ border: 1px solid #ddd;
147
+ padding: 5px;
148
+ }
data/spec/spec_helper.rb CHANGED
@@ -33,6 +33,7 @@ Dir["#{ File.dirname(__FILE__)}/factories/*.rb"].each { |f| require f }
33
33
  RSpec.configure do |config|
34
34
  config.mock_with :rspec
35
35
  config.use_transactional_fixtures = true
36
+ config.include FactoryGirl::Syntax::Methods
36
37
  end
37
38
 
38
39
  # To test generators
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigbluebutton_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-05 00:00:00.000000000Z
13
+ date: 2012-05-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &82282620 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,18 +22,28 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *82282620
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: 3.0.0
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: bigbluebutton-api-ruby
28
- requirement: &82280890 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ~>
32
37
  - !ruby/object:Gem::Version
33
- version: 0.1.0
38
+ version: 1.1.0
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *82280890
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 1.1.0
37
47
  description: It allows you to interact with BigBlueButton from your Ruby on Rails
38
48
  application
39
49
  email: mconf-dev@googlegroups.com
@@ -225,7 +235,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
235
  version: '0'
226
236
  segments:
227
237
  - 0
228
- hash: 483068541
238
+ hash: 342654963
229
239
  required_rubygems_version: !ruby/object:Gem::Requirement
230
240
  none: false
231
241
  requirements:
@@ -234,10 +244,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
244
  version: '0'
235
245
  segments:
236
246
  - 0
237
- hash: 483068541
247
+ hash: 342654963
238
248
  requirements: []
239
249
  rubyforge_project:
240
- rubygems_version: 1.8.10
250
+ rubygems_version: 1.8.24
241
251
  signing_key:
242
252
  specification_version: 3
243
253
  summary: BigBlueButton integration for Ruby on Rails