bigbluebutton_rails 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -2
- data/Gemfile +0 -1
- data/Gemfile.lock +27 -27
- data/Rakefile +15 -14
- data/app/controllers/bigbluebutton/api/rooms_controller.rb +2 -2
- data/app/controllers/bigbluebutton/meetings_controller.rb +69 -0
- data/app/controllers/bigbluebutton/recordings_controller.rb +2 -8
- data/app/controllers/bigbluebutton/rooms_controller.rb +5 -4
- data/app/controllers/bigbluebutton/servers_controller.rb +2 -2
- data/app/models/bigbluebutton_meeting.rb +1 -1
- data/app/models/bigbluebutton_recording.rb +15 -3
- data/app/models/bigbluebutton_room.rb +28 -18
- data/app/models/bigbluebutton_server.rb +9 -9
- data/app/views/bigbluebutton/meetings/_form.html.erb +30 -0
- data/app/views/bigbluebutton/meetings/edit.html.erb +5 -0
- data/app/views/bigbluebutton/recordings/_form.html.erb +0 -4
- data/app/views/bigbluebutton/recordings/_recordings.html.erb +0 -1
- data/app/views/bigbluebutton/recordings/show.html.erb +0 -5
- data/app/views/bigbluebutton/rooms/_form.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/show.html.erb +2 -2
- data/app/views/bigbluebutton/servers/_form.html.erb +2 -2
- data/app/views/bigbluebutton/servers/index.html.erb +1 -1
- data/app/views/bigbluebutton/servers/show.html.erb +2 -2
- data/app/workers/bigbluebutton_recordings_for_room_worker.rb +1 -1
- data/config/locales/en.yml +37 -24
- data/config/locales/pt-br.yml +37 -24
- data/lib/bigbluebutton_rails/configuration.rb +3 -0
- data/lib/bigbluebutton_rails/rails/routes.rb +6 -1
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/lib/generators/bigbluebutton_rails/templates/migration.rb +3 -3
- data/lib/generators/bigbluebutton_rails/templates/migration_2_4_0.rb +18 -0
- data/lib/generators/bigbluebutton_rails/templates/migration_2_5_0.rb +9 -0
- data/spec/controllers/bigbluebutton/api/rooms_controller_spec.rb +3 -3
- data/spec/controllers/bigbluebutton/meetings_controller_spec.rb +199 -0
- data/spec/controllers/bigbluebutton/recordings_controller_spec.rb +3 -3
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +4 -2
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +12 -6
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +8 -8
- data/spec/factories/bigbluebutton_meeting.rb +1 -0
- data/spec/factories/bigbluebutton_recording.rb +0 -1
- data/spec/factories/bigbluebutton_room.rb +1 -1
- data/spec/factories/bigbluebutton_server.rb +1 -1
- data/spec/models/bigbluebutton_meeting_db_spec.rb +2 -0
- data/spec/models/bigbluebutton_meeting_spec.rb +1 -1
- data/spec/models/bigbluebutton_recording_db_spec.rb +0 -1
- data/spec/models/bigbluebutton_recording_spec.rb +0 -4
- data/spec/models/bigbluebutton_room_db_spec.rb +1 -1
- data/spec/models/bigbluebutton_room_spec.rb +58 -69
- data/spec/models/bigbluebutton_server_db_spec.rb +1 -1
- data/spec/models/bigbluebutton_server_spec.rb +26 -26
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/create_servers_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/destroy_rooms_steps.rb +1 -1
- data/spec/rails_app/features/step_definitions/destroy_servers_steps.rb +1 -1
- data/spec/rails_app/features/support/templates.rb +10 -10
- data/spec/rails_app/lib/tasks/db/populate.rake +0 -1
- data/spec/routing/bigbluebutton/meetings_routing_spec.rb +14 -0
- data/spec/support/controllers/bigbluebutton/rooms_controller.rb +6 -2
- data/spec/support/mocked_server.rb +2 -2
- metadata +8 -1
@@ -15,6 +15,7 @@ module BigbluebuttonRails
|
|
15
15
|
attr_accessor :playback_url_authentication
|
16
16
|
attr_accessor :playback_iframe
|
17
17
|
attr_accessor :downloadable_playback_types
|
18
|
+
attr_accessor :debug
|
18
19
|
|
19
20
|
# methods
|
20
21
|
attr_accessor :select_server
|
@@ -32,6 +33,8 @@ module BigbluebuttonRails
|
|
32
33
|
}
|
33
34
|
@routing_scope = 'bigbluebutton'
|
34
35
|
|
36
|
+
@debug = false
|
37
|
+
|
35
38
|
@metadata_room_id = :'bbbrails-room-id'
|
36
39
|
@metadata_user_id = :'bbbrails-user-id'
|
37
40
|
@metadata_user_name = :'bbbrails-user-name'
|
@@ -99,7 +99,7 @@ module ActionDispatch::Routing
|
|
99
99
|
options = params.extract_options!
|
100
100
|
options_scope = options.has_key?(:scope) ? options[:scope] : BigbluebuttonRails.configuration.routing_scope
|
101
101
|
options_as = options.has_key?(:as) ? options[:as] : options_scope
|
102
|
-
options_only = options.has_key?(:only) ? options[:only] : ["servers", "rooms", "recordings", "playback_types"]
|
102
|
+
options_only = options.has_key?(:only) ? options[:only] : ["servers", "rooms", "recordings", "playback_types", "meetings"]
|
103
103
|
BigbluebuttonRails.configuration.set_controllers(options[:controllers])
|
104
104
|
|
105
105
|
scope options_scope, :as => options_as do
|
@@ -107,6 +107,7 @@ module ActionDispatch::Routing
|
|
107
107
|
add_routes_for_rooms if options_only.include?("rooms")
|
108
108
|
add_routes_for_recordings if options_only.include?("recordings")
|
109
109
|
add_routes_for_playback_types if options_only.include?("playback_types")
|
110
|
+
add_routes_for_meetings if options_only.include?("meetings")
|
110
111
|
end
|
111
112
|
end
|
112
113
|
|
@@ -159,5 +160,9 @@ module ActionDispatch::Routing
|
|
159
160
|
resources :playback_types, :only => [:update],
|
160
161
|
:controller => BigbluebuttonRails.configuration.controllers[:playback_types]
|
161
162
|
end
|
163
|
+
|
164
|
+
def add_routes_for_meetings #:nodoc:
|
165
|
+
resources :meetings, :controller => 'bigbluebutton/meetings', :only => [:destroy, :update, :edit]
|
166
|
+
end
|
162
167
|
end
|
163
168
|
end
|
@@ -6,7 +6,7 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
6
6
|
t.string :url
|
7
7
|
t.string :secret
|
8
8
|
t.string :version
|
9
|
-
t.string :
|
9
|
+
t.string :slug
|
10
10
|
t.timestamps
|
11
11
|
end
|
12
12
|
|
@@ -24,7 +24,7 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
24
24
|
t.integer :max_participants
|
25
25
|
t.boolean :private, :default => false
|
26
26
|
t.boolean :external, :default => false
|
27
|
-
t.string :
|
27
|
+
t.string :slug
|
28
28
|
t.boolean :record_meeting, :default => false
|
29
29
|
t.integer :duration, :default => 0
|
30
30
|
t.string :attendee_api_password
|
@@ -59,7 +59,6 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
59
59
|
t.decimal :start_time, precision: 14, scale: 0
|
60
60
|
t.decimal :end_time, precision: 14, scale: 0
|
61
61
|
t.boolean :available, :default => true
|
62
|
-
t.string :description
|
63
62
|
t.integer :size, limit: 8, default: 0
|
64
63
|
t.text :recording_users
|
65
64
|
t.timestamps
|
@@ -105,6 +104,7 @@ class CreateBigbluebuttonRails < ActiveRecord::Migration
|
|
105
104
|
t.string :creator_name
|
106
105
|
t.boolean :ended, :default => false
|
107
106
|
t.string :got_stats
|
107
|
+
t.string :title, limit: 80
|
108
108
|
t.timestamps
|
109
109
|
end
|
110
110
|
add_index :bigbluebutton_meetings, [:meetingid, :create_time], :unique => true
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class BigbluebuttonRailsTo240 < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :bigbluebutton_meetings, :title, :string, limit: 80
|
4
|
+
|
5
|
+
BigbluebuttonMeeting.find_each do |meeting|
|
6
|
+
if meeting.recording.present?
|
7
|
+
meeting.update_attributes(title: meeting.recording.description)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
remove_column :bigbluebutton_recordings, :description
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.down
|
15
|
+
add_column :bigbluebutton_recordings, :description, :string
|
16
|
+
remove_column :bigbluebutton_meetings, :title
|
17
|
+
end
|
18
|
+
end
|
@@ -142,9 +142,9 @@ describe Bigbluebutton::Api::RoomsController do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
context "filtering" do
|
145
|
-
before { room.update_attributes(name: "La Lo",
|
146
|
-
let!(:room2) { FactoryGirl.create(:bigbluebutton_room, name: "La Le",
|
147
|
-
let!(:room3) { FactoryGirl.create(:bigbluebutton_room, name: "Li Lo",
|
145
|
+
before { room.update_attributes(name: "La Lo", slug: "lalo-1") }
|
146
|
+
let!(:room2) { FactoryGirl.create(:bigbluebutton_room, name: "La Le", slug: "lale-2") }
|
147
|
+
let!(:room3) { FactoryGirl.create(:bigbluebutton_room, name: "Li Lo", slug: "lilo") }
|
148
148
|
|
149
149
|
context "filters by terms" do
|
150
150
|
before(:each) { get :index, filter: { terms: 'la' }, format: :json }
|
@@ -0,0 +1,199 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'bigbluebutton_api'
|
3
|
+
|
4
|
+
# Some tests mock the server and its API object
|
5
|
+
# We don't want to trigger real API calls here (this is done in the integration tests)
|
6
|
+
|
7
|
+
describe Bigbluebutton::MeetingsController do
|
8
|
+
render_views
|
9
|
+
let!(:server) { FactoryGirl.create(:bigbluebutton_server) }
|
10
|
+
let!(:meeting) { FactoryGirl.create(:bigbluebutton_meeting) }
|
11
|
+
let!(:rec){ FactoryGirl.create(:bigbluebutton_recording, :published => false, :meeting => meeting) }
|
12
|
+
|
13
|
+
describe '#destroy' do
|
14
|
+
context "when meeting_ended == true" do
|
15
|
+
context "when meeting has no recordings" do
|
16
|
+
let!(:meeting) { FactoryGirl.create(:bigbluebutton_meeting, ended: true) }
|
17
|
+
|
18
|
+
context "when meeting.destroy == true" do
|
19
|
+
before {
|
20
|
+
request.env["HTTP_REFERER"] = '/any'
|
21
|
+
BigbluebuttonServer.any_instance.stub(:send_delete_recordings).and_return(true)
|
22
|
+
expect {
|
23
|
+
delete :destroy, :id => meeting.to_param
|
24
|
+
}.to change{ BigbluebuttonMeeting.count }.by(-1)
|
25
|
+
}
|
26
|
+
it("should decrease meetings count by -1") { }
|
27
|
+
it { should redirect_to '/any' }
|
28
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.delete.success')) }
|
29
|
+
end
|
30
|
+
|
31
|
+
context "when meeting.destroy == false" do
|
32
|
+
before {
|
33
|
+
request.env["HTTP_REFERER"] = '/any'
|
34
|
+
BigbluebuttonMeeting.any_instance.stub(:destroy).and_return(false)
|
35
|
+
expect {
|
36
|
+
delete :destroy, :id => meeting.to_param
|
37
|
+
}.to change{ BigbluebuttonMeeting.count }.by(0)
|
38
|
+
}
|
39
|
+
it("should not decrease meetings count") { }
|
40
|
+
it { should redirect_to '/any' }
|
41
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.notice.destroy.error_destroy')) }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
context "when meeting has recordings" do
|
45
|
+
let!(:meeting) { FactoryGirl.create(:bigbluebutton_meeting, ended: true) }
|
46
|
+
|
47
|
+
context "when meeting.destroy == true" do
|
48
|
+
before {
|
49
|
+
BigbluebuttonServer.any_instance.stub(:send_delete_recordings).and_return(true)
|
50
|
+
request.env["HTTP_REFERER"] = '/any'
|
51
|
+
expect {
|
52
|
+
delete :destroy, :id => meeting.to_param
|
53
|
+
}.to change{ BigbluebuttonRecording.count }.by(-1)
|
54
|
+
}
|
55
|
+
it("should decrease recordings count by -1") { }
|
56
|
+
it { should redirect_to '/any' }
|
57
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.delete.success')) }
|
58
|
+
end
|
59
|
+
|
60
|
+
context "when meeting.destroy == false" do
|
61
|
+
before {
|
62
|
+
request.env["HTTP_REFERER"] = '/any'
|
63
|
+
BigbluebuttonMeeting.any_instance.stub(:destroy).and_return(false)
|
64
|
+
expect {
|
65
|
+
delete :destroy, :id => meeting.to_param
|
66
|
+
}.to change{ BigbluebuttonRecording.count }.by(0)
|
67
|
+
}
|
68
|
+
it("should not decrease Recordings count") { }
|
69
|
+
it { should redirect_to '/any' }
|
70
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.notice.destroy.error_destroy')) }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context "When meeting_ended == false" do
|
76
|
+
let!(:meeting) { FactoryGirl.create(:bigbluebutton_meeting, ended: false) }
|
77
|
+
|
78
|
+
before {
|
79
|
+
request.env["HTTP_REFERER"] = '/any'
|
80
|
+
BigbluebuttonMeeting.any_instance.stub(:destroy).and_return(false)
|
81
|
+
expect {
|
82
|
+
delete :destroy, :id => meeting.to_param
|
83
|
+
}.to change{ BigbluebuttonMeeting.count }.by(0)
|
84
|
+
}
|
85
|
+
it("should not decrease meetings count") { }
|
86
|
+
it { should redirect_to '/any' }
|
87
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.notice.destroy.running.not_ended')) }
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#edit" do
|
93
|
+
context "basic" do
|
94
|
+
before(:each) { get :edit, :id => meeting.to_param }
|
95
|
+
it { should respond_with(:success) }
|
96
|
+
it { should assign_to(:meeting).with(meeting) }
|
97
|
+
it { should render_template(:edit) }
|
98
|
+
end
|
99
|
+
|
100
|
+
context "doesn't override @meeting" do
|
101
|
+
let!(:other_meeting) { FactoryGirl.create(:bigbluebutton_meeting) }
|
102
|
+
before { controller.instance_variable_set(:@meeting, other_meeting) }
|
103
|
+
before(:each) { get :edit, :id => meeting.to_param }
|
104
|
+
it { should assign_to(:meeting).with(other_meeting) }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "#update" do
|
109
|
+
let!(:new_meeting) { FactoryGirl.build(:bigbluebutton_meeting) }
|
110
|
+
|
111
|
+
context "on success" do
|
112
|
+
before(:each) {
|
113
|
+
expect {
|
114
|
+
put :update, :id => meeting.to_param, :bigbluebutton_meeting => new_meeting.attributes
|
115
|
+
}.not_to change{ BigbluebuttonMeeting.count }
|
116
|
+
}
|
117
|
+
it { should respond_with(:redirect) }
|
118
|
+
it {
|
119
|
+
saved = BigbluebuttonMeeting.find(meeting)
|
120
|
+
should redirect_to(bigbluebutton_meeting_path(saved))
|
121
|
+
}
|
122
|
+
it {
|
123
|
+
saved = BigbluebuttonMeeting.find(meeting)
|
124
|
+
ignored = new_meeting.attributes.keys - ['title'] # only description is editable
|
125
|
+
saved.should have_same_attributes_as(new_meeting, ignored)
|
126
|
+
}
|
127
|
+
it { should set_the_flash.to(I18n.t('bigbluebutton_rails.meetings.notice.update.success')) }
|
128
|
+
end
|
129
|
+
|
130
|
+
context "on failure" do
|
131
|
+
before(:each) {
|
132
|
+
BigbluebuttonMeeting.should_receive(:find_by).and_return(meeting)
|
133
|
+
meeting.should_receive(:update_attributes).and_return(false)
|
134
|
+
put :update, :id => meeting.to_param, :bigbluebutton_meeting => new_meeting.attributes
|
135
|
+
}
|
136
|
+
it { should render_template(:edit) }
|
137
|
+
it { should assign_to(:meeting).with(meeting) }
|
138
|
+
end
|
139
|
+
|
140
|
+
describe "params handling" do
|
141
|
+
let(:attrs) { FactoryGirl.attributes_for(:bigbluebutton_meeting) }
|
142
|
+
let(:params) { { :bigbluebutton_meeting => attrs } }
|
143
|
+
let(:allowed_params) {
|
144
|
+
[:title]
|
145
|
+
}
|
146
|
+
it {
|
147
|
+
# we just check that the rails method 'permit' is being called on the hash with the
|
148
|
+
# correct parameters
|
149
|
+
BigbluebuttonMeeting.stub(:find_by).and_return(meeting)
|
150
|
+
meeting.stub(:update_attributes).and_return(true)
|
151
|
+
attrs.stub(:permit).and_return(attrs)
|
152
|
+
controller.stub(:params).and_return(params)
|
153
|
+
|
154
|
+
put :update, :id => meeting.to_param, :bigbluebutton_meeting => attrs
|
155
|
+
# puts attrs.inspect
|
156
|
+
attrs.should have_received(:permit).with(*allowed_params)
|
157
|
+
}
|
158
|
+
end
|
159
|
+
|
160
|
+
# to make sure it doesn't break if the hash informed doesn't have the key :bigbluebutton_meeting
|
161
|
+
describe "if parameters are not informed" do
|
162
|
+
it {
|
163
|
+
put :update, :id => meeting.to_param
|
164
|
+
should redirect_to(bigbluebutton_meeting_path(meeting))
|
165
|
+
}
|
166
|
+
end
|
167
|
+
|
168
|
+
context "with :redir_url" do
|
169
|
+
context "on success" do
|
170
|
+
before(:each) {
|
171
|
+
put :update, :id => meeting.to_param, :bigbluebutton_meeting => new_meeting.attributes, :redir_url => '/any'
|
172
|
+
}
|
173
|
+
it { should respond_with(:redirect) }
|
174
|
+
it { should redirect_to "/any" }
|
175
|
+
end
|
176
|
+
|
177
|
+
context "on failure" do
|
178
|
+
before(:each) {
|
179
|
+
BigbluebuttonMeeting.should_receive(:find_by).and_return(meeting)
|
180
|
+
meeting.should_receive(:update_attributes).and_return(false)
|
181
|
+
put :update, :id => meeting.to_param, :bigbluebutton_meeting => new_meeting.attributes, :redir_url => '/any'
|
182
|
+
}
|
183
|
+
it { should respond_with(:redirect) }
|
184
|
+
it { should redirect_to "/any" }
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
context "doesn't override @meeting" do
|
189
|
+
let!(:other_meeting) { FactoryGirl.create(:bigbluebutton_meeting) }
|
190
|
+
before { controller.instance_variable_set(:@meeting, other_meeting) }
|
191
|
+
before(:each) { put :update, :id => meeting.to_param, :bigbluebutton_meeting => new_meeting.attributes }
|
192
|
+
it { should assign_to(:meeting).with(other_meeting) }
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
end
|
@@ -92,7 +92,7 @@ describe Bigbluebutton::RecordingsController do
|
|
92
92
|
let(:attrs) { FactoryGirl.attributes_for(:bigbluebutton_recording) }
|
93
93
|
let(:params) { { :bigbluebutton_recording => attrs } }
|
94
94
|
let(:allowed_params) {
|
95
|
-
[
|
95
|
+
[]
|
96
96
|
}
|
97
97
|
it {
|
98
98
|
# we just check that the rails method 'permit' is being called on the hash with the
|
@@ -165,7 +165,7 @@ describe Bigbluebutton::RecordingsController do
|
|
165
165
|
before(:each) {
|
166
166
|
expect {
|
167
167
|
delete :destroy, :id => recording.to_param
|
168
|
-
}.to change{ BigbluebuttonRecording.count }.by(
|
168
|
+
}.to change{ BigbluebuttonRecording.count }.by(0)
|
169
169
|
}
|
170
170
|
it { should respond_with(:redirect) }
|
171
171
|
it { should redirect_to bigbluebutton_recordings_url }
|
@@ -202,7 +202,7 @@ describe Bigbluebutton::RecordingsController do
|
|
202
202
|
mocked_server.should_not_receive(:send_delete_recordings)
|
203
203
|
expect {
|
204
204
|
delete :destroy, :id => recording.to_param
|
205
|
-
}.to change{ BigbluebuttonRecording.count }.by(
|
205
|
+
}.to change{ BigbluebuttonRecording.count }.by(0)
|
206
206
|
}
|
207
207
|
it { should respond_with(:redirect) }
|
208
208
|
it { should redirect_to bigbluebutton_recordings_url }
|
@@ -37,10 +37,12 @@ describe Bigbluebutton::RoomsController do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
describe "#running" do
|
40
|
-
before {
|
40
|
+
before {
|
41
|
+
mocked_api.should_receive(:is_meeting_running?) { raise bbb_error }
|
42
|
+
}
|
41
43
|
before(:each) { get :running, :id => room.to_param }
|
42
44
|
it { should respond_with(:success) }
|
43
|
-
it { response.body.should == build_running_json(false, bbb_error_msg[0..200]) }
|
45
|
+
it { response.body.should == build_running_json(false,{}, bbb_error_msg[0..200]) }
|
44
46
|
it { should set_the_flash.to(bbb_error_msg[0..200]) }
|
45
47
|
end
|
46
48
|
|
@@ -207,7 +207,7 @@ describe Bigbluebutton::RoomsController do
|
|
207
207
|
let(:allowed_params) {
|
208
208
|
[ :name, :meetingid, :attendee_key, :moderator_key, :welcome_msg,
|
209
209
|
:private, :logout_url, :dial_number, :voice_bridge, :max_participants, :owner_id,
|
210
|
-
:owner_type, :external, :
|
210
|
+
:owner_type, :external, :slug, :record_meeting, :duration, :default_layout, :presenter_share_only,
|
211
211
|
:auto_start_video, :auto_start_audio, :background,
|
212
212
|
:moderator_only_message, :auto_start_recording, :allow_start_stop_recording,
|
213
213
|
:metadata_attributes => [ :id, :name, :content, :_destroy, :owner_id ] ]
|
@@ -299,7 +299,7 @@ describe Bigbluebutton::RoomsController do
|
|
299
299
|
let(:allowed_params) {
|
300
300
|
[ :name, :meetingid, :attendee_key, :moderator_key, :welcome_msg,
|
301
301
|
:private, :logout_url, :dial_number, :voice_bridge, :max_participants, :owner_id,
|
302
|
-
:owner_type, :external, :
|
302
|
+
:owner_type, :external, :slug, :record_meeting, :duration, :default_layout, :presenter_share_only,
|
303
303
|
:auto_start_video, :auto_start_audio, :background,
|
304
304
|
:moderator_only_message, :auto_start_recording, :allow_start_stop_recording,
|
305
305
|
:metadata_attributes => [ :id, :name, :content, :_destroy, :owner_id ] ]
|
@@ -408,18 +408,24 @@ describe Bigbluebutton::RoomsController do
|
|
408
408
|
}
|
409
409
|
|
410
410
|
context "room is running" do
|
411
|
-
before {
|
411
|
+
before {
|
412
|
+
@api_mock.should_receive(:is_meeting_running?).and_return(true)
|
413
|
+
@api_mock.should_receive(:get_meeting_info).and_return({running: true, participantCount: 12})
|
414
|
+
}
|
412
415
|
before(:each) { get :running, :id => room.to_param }
|
413
416
|
it { should respond_with(:success) }
|
414
417
|
it { should respond_with_content_type('application/json') }
|
415
418
|
it { should assign_to(:room).with(room) }
|
416
|
-
it { response.body.should == build_running_json(true) }
|
419
|
+
it { response.body.should == build_running_json(true,{running: true, participantCount: 12}) }
|
417
420
|
end
|
418
421
|
|
419
422
|
context "room is not running" do
|
420
|
-
before {
|
423
|
+
before {
|
424
|
+
mocked_api.should_receive(:is_meeting_running?).and_return(false)
|
425
|
+
@api_mock.should_receive(:get_meeting_info).and_return({running: false})
|
426
|
+
}
|
421
427
|
before(:each) { get :running, :id => room.to_param }
|
422
|
-
it { response.body.should == build_running_json(false) }
|
428
|
+
it { response.body.should == build_running_json(false,{running: false}) }
|
423
429
|
end
|
424
430
|
|
425
431
|
context "on failure" do
|
@@ -88,7 +88,7 @@ describe Bigbluebutton::ServersController do
|
|
88
88
|
let(:attrs) { FactoryGirl.attributes_for(:bigbluebutton_server) }
|
89
89
|
let(:params) { { :bigbluebutton_server => attrs } }
|
90
90
|
let(:allowed_params) {
|
91
|
-
[ :name, :url, :secret, :
|
91
|
+
[ :name, :url, :secret, :slug ]
|
92
92
|
}
|
93
93
|
|
94
94
|
it {
|
@@ -178,13 +178,13 @@ describe Bigbluebutton::ServersController do
|
|
178
178
|
let(:attrs) { FactoryGirl.attributes_for(:bigbluebutton_server) }
|
179
179
|
let(:params) { { :bigbluebutton_server => attrs } }
|
180
180
|
let(:allowed_params) {
|
181
|
-
[ :name, :url, :secret, :
|
181
|
+
[ :name, :url, :secret, :slug ]
|
182
182
|
}
|
183
183
|
|
184
184
|
it {
|
185
185
|
# we just check that the rails method 'permit' is being called on the hash with the
|
186
186
|
# correct parameters
|
187
|
-
BigbluebuttonServer.stub(:
|
187
|
+
BigbluebuttonServer.stub(:find_by).and_return(server)
|
188
188
|
server.stub(:update_attributes).and_return(true)
|
189
189
|
attrs.stub(:permit).and_return(attrs)
|
190
190
|
controller.stub(:params).and_return(params)
|
@@ -269,7 +269,7 @@ describe Bigbluebutton::ServersController do
|
|
269
269
|
let(:room2) { FactoryGirl.create(:bigbluebutton_room) }
|
270
270
|
before do
|
271
271
|
# return our mocked server
|
272
|
-
BigbluebuttonServer.stub(:
|
272
|
+
BigbluebuttonServer.stub(:find_by).with(slug: server.to_param).
|
273
273
|
and_return(server)
|
274
274
|
end
|
275
275
|
|
@@ -338,7 +338,7 @@ describe Bigbluebutton::ServersController do
|
|
338
338
|
let(:recording_ids) { "id1,id2,id3" }
|
339
339
|
before do
|
340
340
|
# return our mocked server
|
341
|
-
BigbluebuttonServer.stub(:
|
341
|
+
BigbluebuttonServer.stub(:find_by).with(slug: server.to_param).and_return(server)
|
342
342
|
end
|
343
343
|
|
344
344
|
context "on success" do
|
@@ -398,7 +398,7 @@ describe Bigbluebutton::ServersController do
|
|
398
398
|
let(:recording_ids) { "id1,id2,id3" }
|
399
399
|
before do
|
400
400
|
# return our mocked server
|
401
|
-
BigbluebuttonServer.stub(:
|
401
|
+
BigbluebuttonServer.stub(:find_by).with(slug: server.to_param).and_return(server)
|
402
402
|
end
|
403
403
|
|
404
404
|
context "on success" do
|
@@ -456,7 +456,7 @@ describe Bigbluebutton::ServersController do
|
|
456
456
|
describe "#fetch_recordings" do
|
457
457
|
before do
|
458
458
|
# return our mocked server
|
459
|
-
BigbluebuttonServer.stub(:
|
459
|
+
BigbluebuttonServer.stub(:find_by).with(slug: server.to_param).and_return(server)
|
460
460
|
end
|
461
461
|
|
462
462
|
context "on success" do
|
@@ -560,7 +560,7 @@ describe Bigbluebutton::ServersController do
|
|
560
560
|
describe "#check" do
|
561
561
|
before do
|
562
562
|
# return our mocked server
|
563
|
-
BigbluebuttonServer.stub(:
|
563
|
+
BigbluebuttonServer.stub(:find_by).with(slug: server.to_param).and_return(server)
|
564
564
|
end
|
565
565
|
|
566
566
|
context "on success" do
|