bigbluebutton_rails 1.2.0 → 1.3.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -0
- data/.travis.yml +2 -2
- data/CHANGELOG.rdoc +15 -1
- data/Gemfile +15 -4
- data/Gemfile.lock +187 -125
- data/LICENSE +24 -0
- data/README.rdoc +96 -19
- data/Rakefile +32 -16
- data/TODO_08 +9 -10
- data/{spec/rails_app/public → app/assets}/stylesheets/bigbluebutton_rails.css +58 -79
- data/app/controllers/bigbluebutton/recordings_controller.rb +142 -0
- data/app/controllers/bigbluebutton/rooms_controller.rb +105 -50
- data/app/controllers/bigbluebutton/servers_controller.rb +78 -2
- data/app/helpers/bigbluebutton_rails_helper.rb +11 -4
- data/app/models/bigbluebutton_metadata.rb +43 -0
- data/app/models/bigbluebutton_playback_format.rb +9 -0
- data/app/models/bigbluebutton_recording.rb +191 -0
- data/app/models/bigbluebutton_room.rb +92 -66
- data/app/models/bigbluebutton_server.rb +49 -3
- data/app/views/bigbluebutton/recordings/_form.html.erb +67 -0
- data/app/views/bigbluebutton/recordings/_recordings.html.erb +56 -0
- data/app/views/bigbluebutton/recordings/edit.html.erb +5 -0
- data/app/views/bigbluebutton/recordings/index.html.erb +2 -0
- data/app/views/bigbluebutton/recordings/show.html.erb +84 -0
- data/app/views/bigbluebutton/rooms/_form.html.erb +28 -7
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +19 -4
- data/app/views/bigbluebutton/rooms/edit.html.erb +0 -1
- data/app/views/bigbluebutton/rooms/invite.html.erb +2 -1
- data/app/views/bigbluebutton/rooms/join.html.erb +0 -2
- data/app/views/bigbluebutton/rooms/recordings.html.erb +2 -0
- data/app/views/bigbluebutton/rooms/show.html.erb +35 -15
- data/app/views/bigbluebutton/servers/_form.html.erb +4 -0
- data/app/views/bigbluebutton/servers/index.html.erb +8 -3
- data/app/views/bigbluebutton/servers/recordings.html.erb +2 -0
- data/app/views/bigbluebutton/servers/rooms.html.erb +1 -1
- data/app/views/bigbluebutton/servers/show.html.erb +54 -6
- data/bigbluebutton_rails.gemspec +1 -1
- data/config/locales/en.yml +105 -55
- data/config/schedule.rb +3 -0
- data/lib/bigbluebutton_rails.rb +52 -2
- data/lib/bigbluebutton_rails/controller_methods.rb +31 -0
- data/lib/bigbluebutton_rails/rails/routes.rb +50 -14
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/lib/generators/bigbluebutton_rails/install_generator.rb +8 -8
- data/lib/generators/bigbluebutton_rails/templates/migration.rb +37 -1
- data/lib/generators/bigbluebutton_rails/templates/migration_1_3_0.rb +55 -0
- data/lib/generators/bigbluebutton_rails/templates/migration_1_3_0_b.rb +13 -0
- data/lib/generators/bigbluebutton_rails/views_generator.rb +6 -2
- data/lib/tasks/bigbluebutton_rails/recordings.rake +18 -0
- data/spec/bigbluebutton_rails_spec.rb +2 -2
- data/spec/controllers/bigbluebutton/recordings_controller_json_responses_spec.rb +111 -0
- data/spec/controllers/bigbluebutton/recordings_controller_spec.rb +188 -0
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +15 -10
- data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +14 -7
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +327 -103
- data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +12 -12
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +166 -28
- data/spec/factories/bigbluebutton_metadata.rb +11 -0
- data/spec/factories/bigbluebutton_playback_format.rb +8 -0
- data/spec/factories/bigbluebutton_recording.rb +13 -0
- data/spec/factories/bigbluebutton_room.rb +2 -1
- data/spec/factories/bigbluebutton_server.rb +1 -1
- data/spec/factories/user.rb +1 -0
- data/spec/generators/install_generator_spec.rb +21 -10
- data/spec/generators/views_generator_spec.rb +14 -4
- data/spec/models/bigbluebutton_metadata_db_spec.rb +13 -0
- data/spec/models/bigbluebutton_metadata_spec.rb +64 -0
- data/spec/models/bigbluebutton_playback_format_db_spec.rb +13 -0
- data/spec/models/bigbluebutton_playback_format_spec.rb +22 -0
- data/spec/models/bigbluebutton_recording_db_spec.rb +24 -0
- data/spec/models/bigbluebutton_recording_spec.rb +450 -0
- data/spec/models/bigbluebutton_room_db_spec.rb +3 -2
- data/spec/models/bigbluebutton_room_spec.rb +194 -166
- data/spec/models/bigbluebutton_server_spec.rb +107 -27
- data/spec/rails_app/.gitignore +2 -0
- data/spec/rails_app/app/assets/javascripts/application.js +2 -0
- data/spec/rails_app/app/controllers/application_controller.rb +2 -0
- data/spec/rails_app/app/controllers/custom_recordings_controller.rb +8 -0
- data/spec/rails_app/app/controllers/frontpage_controller.rb +7 -0
- data/spec/rails_app/app/views/frontpage/show.html.erb +5 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +5 -2
- data/spec/rails_app/config/application.rb +13 -0
- data/spec/rails_app/config/environments/development.rb +7 -2
- data/spec/rails_app/config/environments/production.rb +9 -0
- data/spec/rails_app/config/environments/test.rb +10 -0
- data/spec/rails_app/config/routes.rb +20 -2
- data/spec/rails_app/features/edit_rooms.feature +2 -3
- data/spec/rails_app/features/edit_servers.feature +2 -3
- data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +2 -2
- data/spec/rails_app/features/step_definitions/common_steps.rb +5 -5
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +2 -4
- data/spec/rails_app/features/step_definitions/create_servers_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/edit_rooms_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/edit_servers_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +2 -2
- data/spec/rails_app/features/step_definitions/list_and_show_rooms_steps.rb +2 -2
- data/spec/rails_app/features/support/templates.rb +2 -6
- data/spec/rails_app/lib/tasks/db/populate.rake +119 -0
- data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +78 -1
- data/spec/routing/bigbluebutton/recordings_only_routing_spec.rb +43 -0
- data/spec/routing/bigbluebutton/recordings_routing_spec.rb +46 -0
- data/spec/routing/bigbluebutton/rooms_only_routing_spec.rb +67 -0
- data/spec/routing/bigbluebutton/rooms_routing_spec.rb +28 -2
- data/spec/routing/bigbluebutton/servers_only_routing_spec.rb +43 -0
- data/spec/routing/bigbluebutton/servers_routing_spec.rb +16 -1
- data/spec/support/matchers/have_same_attributes_as.rb +20 -3
- data/spec/support/matchers/shoulda/{be_boolean.rb → be_boolean_matcher.rb} +0 -0
- data/spec/support/mocked_server.rb +19 -3
- metadata +48 -28
- data/public/images/loading.gif +0 -0
- data/public/javascripts/jquery.min.js +0 -16
- data/public/stylesheets/bigbluebutton_rails.css +0 -148
- data/spec/rails_app/public/images/loading.gif +0 -0
- data/spec/rails_app/public/images/rails.png +0 -0
- data/spec/rails_app/public/index.html +0 -239
- data/spec/rails_app/public/javascripts/application.js +0 -2
- data/spec/rails_app/public/javascripts/controls.js +0 -965
- data/spec/rails_app/public/javascripts/dragdrop.js +0 -974
- data/spec/rails_app/public/javascripts/effects.js +0 -1123
- data/spec/rails_app/public/javascripts/jquery.min.js +0 -16
- data/spec/rails_app/public/javascripts/prototype.js +0 -6001
- data/spec/rails_app/public/javascripts/rails.js +0 -191
- data/spec/support/shared_examples/rooms_controller.rb +0 -37
@@ -1,9 +1,8 @@
|
|
1
1
|
When /^registers a new room$/i do
|
2
|
-
attrs =
|
2
|
+
attrs = FactoryGirl.attributes_for(:bigbluebutton_room, :server => @server)
|
3
3
|
fill_in("bigbluebutton_room[server_id]", :with => attrs[:server_id])
|
4
4
|
fill_in("bigbluebutton_room[name]", :with => attrs[:name])
|
5
5
|
fill_in("bigbluebutton_room[meetingid]", :with => attrs[:meetingid])
|
6
|
-
check("bigbluebutton_room[randomize_meetingid]") if attrs[:randomize_meetingid]
|
7
6
|
check("bigbluebutton_room[private]") if attrs[:private]
|
8
7
|
fill_in("bigbluebutton_room[attendee_password]", :with => attrs[:attendee_password])
|
9
8
|
fill_in("bigbluebutton_room[moderator_password]", :with => attrs[:moderator_password])
|
@@ -18,10 +17,9 @@ When /^registers a new room$/i do
|
|
18
17
|
end
|
19
18
|
|
20
19
|
When /^registers a new room with wrong parameters$/i do
|
21
|
-
attrs =
|
20
|
+
attrs = FactoryGirl.attributes_for(:bigbluebutton_room, :server => @server)
|
22
21
|
fill_in("bigbluebutton_room[name]", :with => nil) # invalid
|
23
22
|
fill_in("bigbluebutton_room[meetingid]", :with => attrs[:meetingid])
|
24
|
-
check("bigbluebutton_room[randomize_meetingid]") if attrs[:randomize_meetingid]
|
25
23
|
check("bigbluebutton_room[private]") if attrs[:private]
|
26
24
|
fill_in("bigbluebutton_room[attendee_password]", :with => attrs[:attendee_password])
|
27
25
|
fill_in("bigbluebutton_room[moderator_password]", :with => attrs[:moderator_password])
|
@@ -1,5 +1,5 @@
|
|
1
1
|
When /^registers a new server$/i do
|
2
|
-
attrs =
|
2
|
+
attrs = FactoryGirl.attributes_for(:bigbluebutton_server_integration)
|
3
3
|
fill_in("bigbluebutton_server[name]", :with => attrs[:name])
|
4
4
|
fill_in("bigbluebutton_server[url]", :with => attrs[:url])
|
5
5
|
fill_in("bigbluebutton_server[salt]", :with => attrs[:salt])
|
@@ -9,7 +9,7 @@ When /^registers a new server$/i do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
When /^registers a new server with a wrong URL$/i do
|
12
|
-
attrs =
|
12
|
+
attrs = FactoryGirl.attributes_for(:bigbluebutton_server_integration)
|
13
13
|
fill_in("bigbluebutton_server[name]", :with => attrs[:name])
|
14
14
|
fill_in("bigbluebutton_server[url]", :with => "invalid url")
|
15
15
|
fill_in("bigbluebutton_server[salt]", :with => attrs[:salt])
|
@@ -2,8 +2,8 @@ When /^change the room name to "(.*)"$/ do |name|
|
|
2
2
|
fill_in("bigbluebutton_room[name]", :with => name)
|
3
3
|
end
|
4
4
|
|
5
|
-
When /^
|
6
|
-
find(:css, "input
|
5
|
+
When /^clicks in the button to save the room$/ do
|
6
|
+
find(:css, "input[type=submit]").click
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^the room name should( not)? be "(.+)"$/i do |negate, name|
|
@@ -2,8 +2,8 @@ When /^change the server URL to "(.+)"$/ do |url|
|
|
2
2
|
fill_in("bigbluebutton_server[url]", :with => url)
|
3
3
|
end
|
4
4
|
|
5
|
-
When /^
|
6
|
-
find(:css, "input
|
5
|
+
When /^clicks in the button to save the server$/ do
|
6
|
+
find(:css, "input[type=submit]").click
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^the server URL should( not)? be "(.+)"$/i do |negate, url|
|
@@ -16,9 +16,9 @@ end
|
|
16
16
|
|
17
17
|
When /^he should( not)? join the conference room$/i do |negate|
|
18
18
|
if negate.nil?
|
19
|
-
current_url.should match(/\/client\/
|
19
|
+
current_url.should match(/\/client\/MconfLive\.html/) # BBB client page
|
20
20
|
else
|
21
|
-
current_url.should_not match(/\/client\/
|
21
|
+
current_url.should_not match(/\/client\/MconfLive\.html/)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -7,9 +7,9 @@ When /^he should see all the information available for this room$/i do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
When /^(\d+) room(s)? in any other server$/i do |count, _|
|
10
|
-
any_other_server =
|
10
|
+
any_other_server = FactoryGirl.create(:bigbluebutton_server)
|
11
11
|
count.to_i.times do
|
12
|
-
|
12
|
+
FactoryGirl.create(:bigbluebutton_room, :server => any_other_server)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -70,7 +70,7 @@ module TemplateHelpers
|
|
70
70
|
has_element("a", { :href => bigbluebutton_rooms_path }) # rooms list
|
71
71
|
n = 1
|
72
72
|
servers.each do |server|
|
73
|
-
within(make_selector("ul#
|
73
|
+
within(make_selector("ul#bbbrails_list>li:nth(#{n})")) do
|
74
74
|
# server data
|
75
75
|
has_content(server.name)
|
76
76
|
has_content(server.url)
|
@@ -135,8 +135,6 @@ module TemplateHelpers
|
|
135
135
|
{ :name => 'bigbluebutton_room[name]', :type => 'text' })
|
136
136
|
has_element("input#bigbluebutton_room_meetingid",
|
137
137
|
{ :name => 'bigbluebutton_room[meetingid]', :type => 'text' })
|
138
|
-
has_element("input#bigbluebutton_room_randomize_meetingid",
|
139
|
-
{ :name => 'bigbluebutton_room[randomize_meetingid]', :type => 'checkbox' })
|
140
138
|
has_element("input#bigbluebutton_room_private",
|
141
139
|
{ :name => 'bigbluebutton_room[private]', :type => 'checkbox' })
|
142
140
|
has_element("input#bigbluebutton_room_attendee_password",
|
@@ -159,7 +157,6 @@ module TemplateHelpers
|
|
159
157
|
{ :name => 'bigbluebutton_room[voice_bridge]', :type => 'text' })
|
160
158
|
has_element("label", { :for => 'bigbluebutton_room_name' })
|
161
159
|
has_element("label", { :for => 'bigbluebutton_room_meetingid' })
|
162
|
-
has_element("label", { :for => 'bigbluebutton_room_randomize_meetingid' })
|
163
160
|
has_element("label", { :for => 'bigbluebutton_room_private' })
|
164
161
|
has_element("label", { :for => 'bigbluebutton_room_attendee_password' })
|
165
162
|
has_element("label", { :for => 'bigbluebutton_room_moderator_password' })
|
@@ -180,7 +177,6 @@ module TemplateHelpers
|
|
180
177
|
page_has_content(room.server_id)
|
181
178
|
page_has_content(room.name)
|
182
179
|
page_has_content(room.meetingid)
|
183
|
-
page_has_content(room.randomize_meetingid)
|
184
180
|
page_has_content(room.private)
|
185
181
|
page_has_content(room.attendee_password)
|
186
182
|
page_has_content(room.moderator_password)
|
@@ -237,7 +233,7 @@ module TemplateHelpers
|
|
237
233
|
has_element("a", { :href => bigbluebutton_servers_path }) # servers list
|
238
234
|
n = 1
|
239
235
|
rooms.each do |room|
|
240
|
-
within(make_selector("ul#
|
236
|
+
within(make_selector("ul#bbbrails_list>li:nth(#{n})")) do
|
241
237
|
# room data
|
242
238
|
has_content(room.server_id) unless room.server.nil?
|
243
239
|
has_content(room.name)
|
@@ -0,0 +1,119 @@
|
|
1
|
+
require 'forgery'
|
2
|
+
|
3
|
+
namespace :db do
|
4
|
+
|
5
|
+
desc "Populate the DB with random test data."
|
6
|
+
task :populate => :environment do
|
7
|
+
|
8
|
+
puts "- Destroying all old data"
|
9
|
+
BigbluebuttonServer.destroy_all
|
10
|
+
BigbluebuttonRoom.destroy_all
|
11
|
+
BigbluebuttonRecording.destroy_all
|
12
|
+
BigbluebuttonMetadata.destroy_all
|
13
|
+
BigbluebuttonPlaybackFormat.destroy_all
|
14
|
+
|
15
|
+
# Servers
|
16
|
+
2.times do |n1|
|
17
|
+
params = {
|
18
|
+
:name => "Server #{n1}",
|
19
|
+
:url => "http://bigbluebutton#{n1}.test.com/bigbluebutton/api",
|
20
|
+
:salt => Forgery(:basic).password(:at_least => 30, :at_most => 40),
|
21
|
+
:version => '0.8',
|
22
|
+
:param => "server-#{n1}"
|
23
|
+
}
|
24
|
+
puts "- Creating server #{params[:name]}"
|
25
|
+
server = BigbluebuttonServer.create!(params)
|
26
|
+
|
27
|
+
# Rooms
|
28
|
+
2.times do |n2|
|
29
|
+
params = {
|
30
|
+
:meetingid => "meeting-#{n1}-#{n2}-" + SecureRandom.hex(4),
|
31
|
+
:server => server,
|
32
|
+
:name => "Name-#{n1}-#{n2}",
|
33
|
+
:attendee_password => Forgery(:basic).password(:at_least => 10, :at_most => 16),
|
34
|
+
:moderator_password => Forgery(:basic).password(:at_least => 10, :at_most => 16),
|
35
|
+
:welcome_msg => Forgery(:lorem_ipsum).sentences(2),
|
36
|
+
:private => false,
|
37
|
+
:param => "meeting-#{n1}-#{n2}",
|
38
|
+
:external => false,
|
39
|
+
:record => false,
|
40
|
+
:duration => 0
|
41
|
+
}
|
42
|
+
puts " - Creating room #{params[:name]}"
|
43
|
+
room = BigbluebuttonRoom.create!(params)
|
44
|
+
|
45
|
+
# Room metadata
|
46
|
+
3.times do |n_metadata|
|
47
|
+
params = {
|
48
|
+
:name => "#{Forgery(:name).first_name.downcase}-#{n_metadata}",
|
49
|
+
:content => Forgery(:name).full_name
|
50
|
+
}
|
51
|
+
puts " - Creating room metadata #{params[:name]}"
|
52
|
+
metadata = BigbluebuttonMetadata.create(params)
|
53
|
+
metadata.owner = room
|
54
|
+
metadata.save!
|
55
|
+
end
|
56
|
+
|
57
|
+
# Recordings
|
58
|
+
2.times do |n3|
|
59
|
+
params = {
|
60
|
+
:recordid => "rec-#{n1}-#{n2}-#{n3}-" + SecureRandom.hex(26),
|
61
|
+
:meetingid => room.meetingid,
|
62
|
+
:name => "Rec-#{n1}-#{n2}-#{n3}",
|
63
|
+
:published => true,
|
64
|
+
:available => true,
|
65
|
+
:start_time => Time.now - rand(5).hours,
|
66
|
+
:end_time => Time.now + rand(5).hours
|
67
|
+
}
|
68
|
+
puts " - Creating recording #{params[:name]}"
|
69
|
+
recording = BigbluebuttonRecording.create(params)
|
70
|
+
recording.server = server
|
71
|
+
recording.room = room
|
72
|
+
recording.save!
|
73
|
+
|
74
|
+
# Basic metadata the gem always adds and should always be there
|
75
|
+
basic_metadata =
|
76
|
+
[{
|
77
|
+
:name => BigbluebuttonRails.metadata_user_id,
|
78
|
+
:content => Forgery(:basic).number(:at_most => 1000)
|
79
|
+
}, {
|
80
|
+
:name => BigbluebuttonRails.metadata_user_name,
|
81
|
+
:content => Forgery(:name).full_name
|
82
|
+
}]
|
83
|
+
basic_metadata.each do |meta_params|
|
84
|
+
metadata = BigbluebuttonMetadata.create(meta_params)
|
85
|
+
metadata.owner = recording
|
86
|
+
metadata.save!
|
87
|
+
puts " - Creating recording metadata #{meta_params[:name]}"
|
88
|
+
end
|
89
|
+
|
90
|
+
# Recording metadata
|
91
|
+
3.times do |n_metadata|
|
92
|
+
params = {
|
93
|
+
:name => "#{Forgery(:name).first_name.downcase}-#{n_metadata}",
|
94
|
+
:content => Forgery(:name).full_name
|
95
|
+
}
|
96
|
+
puts " - Creating recording metadata #{params[:name]}"
|
97
|
+
metadata = BigbluebuttonMetadata.create(params)
|
98
|
+
metadata.owner = recording
|
99
|
+
metadata.save!
|
100
|
+
end
|
101
|
+
|
102
|
+
# Recording playback formats
|
103
|
+
2.times do |n_format|
|
104
|
+
params = {
|
105
|
+
:format_type => "#{Forgery(:name).first_name.downcase}-#{n_format}",
|
106
|
+
:url => "http://" + Forgery(:internet).domain_name + "/playback",
|
107
|
+
:length => Forgery(:basic).number
|
108
|
+
}
|
109
|
+
puts " - Creating playback format #{params[:format_type]}"
|
110
|
+
format = BigbluebuttonPlaybackFormat.create(params)
|
111
|
+
format.recording = recording
|
112
|
+
format.save!
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -38,6 +38,22 @@ describe ActionController do
|
|
38
38
|
{:get => "/custom/servers/1/activity"}.
|
39
39
|
should route_to(:controller => "custom_servers", :action => "activity", :id => "1")
|
40
40
|
}
|
41
|
+
it {
|
42
|
+
{:get => "/custom/servers/1/recordings"}.
|
43
|
+
should route_to(:controller => "custom_servers", :action => "recordings", :id => "1")
|
44
|
+
}
|
45
|
+
it {
|
46
|
+
{:post => "/custom/servers/1/publish_recordings"}.
|
47
|
+
should route_to(:controller => "custom_servers", :action => "publish_recordings", :id => "1")
|
48
|
+
}
|
49
|
+
it {
|
50
|
+
{:post => "/custom/servers/1/unpublish_recordings"}.
|
51
|
+
should route_to(:controller => "custom_servers", :action => "unpublish_recordings", :id => "1")
|
52
|
+
}
|
53
|
+
it {
|
54
|
+
{:post => "/custom/servers/1/fetch_recordings"}.
|
55
|
+
should route_to(:controller => "custom_servers", :action => "fetch_recordings", :id => "1")
|
56
|
+
}
|
41
57
|
|
42
58
|
# custom controllers - rooms
|
43
59
|
it {
|
@@ -96,8 +112,69 @@ describe ActionController do
|
|
96
112
|
{:post => "/custom/rooms/1/join"}.
|
97
113
|
should route_to(:controller => "custom_rooms", :action => "auth", :id => "1")
|
98
114
|
}
|
115
|
+
it {
|
116
|
+
{:post => "/custom/rooms/1/fetch_recordings"}.
|
117
|
+
should route_to(:controller => "custom_rooms", :action => "fetch_recordings", :id => "1")
|
118
|
+
}
|
119
|
+
it {
|
120
|
+
{:get => "/custom/rooms/1/recordings"}.
|
121
|
+
should route_to(:controller => "custom_rooms", :action => "recordings", :id => "1")
|
122
|
+
}
|
123
|
+
|
124
|
+
# custom controllers - recordings
|
125
|
+
it {
|
126
|
+
{:get => "/custom/recordings"}.
|
127
|
+
should route_to(:controller => "custom_recordings", :action => "index")
|
128
|
+
}
|
129
|
+
it {
|
130
|
+
{:get => "/custom/recordings/1/edit"}.
|
131
|
+
should route_to(:controller => "custom_recordings", :action => "edit", :id => "1")
|
132
|
+
}
|
133
|
+
it {
|
134
|
+
{:get => "/custom/recordings/1"}.
|
135
|
+
should route_to(:controller => "custom_recordings", :action => "show", :id => "1")
|
136
|
+
}
|
137
|
+
it {
|
138
|
+
{:put => "/custom/recordings/1"}.
|
139
|
+
should route_to(:controller => "custom_recordings", :action => "update", :id => "1")
|
140
|
+
}
|
141
|
+
it {
|
142
|
+
{:delete => "/custom/recordings/1"}.
|
143
|
+
should route_to(:controller => "custom_recordings", :action => "destroy", :id => "1")
|
144
|
+
}
|
145
|
+
|
146
|
+
context "custom named route helpers" do
|
147
|
+
let(:server) { FactoryGirl.create(:bigbluebutton_server) }
|
148
|
+
let(:room) { FactoryGirl.create(:bigbluebutton_room) }
|
149
|
+
let(:recording) { FactoryGirl.create(:bigbluebutton_recording) }
|
150
|
+
|
151
|
+
it { custom_name_servers_path.should == "/custom/servers" }
|
152
|
+
it { new_custom_name_server_path.should == "/custom/servers/new" }
|
153
|
+
it { edit_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/edit" }
|
154
|
+
it { custom_name_server_path(server).should == "/custom/servers/#{server.to_param}" }
|
155
|
+
it { activity_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/activity" }
|
156
|
+
it { fetch_recordings_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/fetch_recordings" }
|
157
|
+
it { recordings_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/recordings" }
|
158
|
+
it { publish_recordings_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/publish_recordings" }
|
159
|
+
it { unpublish_recordings_custom_name_server_path(server).should == "/custom/servers/#{server.to_param}/unpublish_recordings" }
|
160
|
+
|
161
|
+
it { custom_name_rooms_path.should == "/custom/rooms" }
|
162
|
+
it { new_custom_name_room_path.should == "/custom/rooms/new" }
|
163
|
+
it { edit_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/edit" }
|
164
|
+
it { custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}" }
|
165
|
+
it { external_custom_name_rooms_path.should == "/custom/rooms/external" }
|
166
|
+
it { join_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/join" }
|
167
|
+
it { join_mobile_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/join_mobile" }
|
168
|
+
it { end_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/end" }
|
169
|
+
it { invite_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/invite" }
|
170
|
+
it { fetch_recordings_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/fetch_recordings" }
|
171
|
+
it { recordings_custom_name_room_path(room).should == "/custom/rooms/#{room.to_param}/recordings" }
|
172
|
+
|
173
|
+
it { custom_name_recordings_path.should == "/custom/recordings" }
|
174
|
+
it { edit_custom_name_recording_path(recording).should == "/custom/recordings/#{recording.to_param}/edit" }
|
175
|
+
it { custom_name_recording_path(recording).should == "/custom/recordings/#{recording.to_param}" }
|
176
|
+
end
|
99
177
|
|
100
178
|
end
|
101
179
|
|
102
180
|
end
|
103
|
-
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ActionController do
|
4
|
+
include Shoulda::Matchers::ActionController
|
5
|
+
|
6
|
+
describe "routing with :only => 'recordings'" do
|
7
|
+
|
8
|
+
it {
|
9
|
+
{:get => "/only-recordings/bigbluebutton/recordings"}.
|
10
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "index")
|
11
|
+
}
|
12
|
+
it {
|
13
|
+
{:get => "/only-recordings/bigbluebutton/recordings/rec-1/edit"}.
|
14
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "edit", :id => "rec-1")
|
15
|
+
}
|
16
|
+
it {
|
17
|
+
{:get => "/only-recordings/bigbluebutton/recordings/rec-1"}.
|
18
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "show", :id => "rec-1")
|
19
|
+
}
|
20
|
+
it {
|
21
|
+
{:put => "/only-recordings/bigbluebutton/recordings/rec-1"}.
|
22
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "update", :id => "rec-1")
|
23
|
+
}
|
24
|
+
it {
|
25
|
+
{:delete => "/only-recordings/bigbluebutton/recordings/rec-1"}.
|
26
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "destroy", :id => "rec-1")
|
27
|
+
}
|
28
|
+
it {
|
29
|
+
{:get => "/only-recordings/bigbluebutton/recordings/rec-1/play?type=any"}.
|
30
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "play", :id => "rec-1")
|
31
|
+
}
|
32
|
+
it {
|
33
|
+
{:post => "/only-recordings/bigbluebutton/recordings/rec-1/publish"}.
|
34
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "publish", :id => "rec-1")
|
35
|
+
}
|
36
|
+
it {
|
37
|
+
{:post => "/only-recordings/bigbluebutton/recordings/rec-1/unpublish"}.
|
38
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "unpublish", :id => "rec-1")
|
39
|
+
}
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bigbluebutton::RecordingsController do
|
4
|
+
include Shoulda::Matchers::ActionController
|
5
|
+
|
6
|
+
describe "routing" do
|
7
|
+
|
8
|
+
# default and scoped routes
|
9
|
+
['bigbluebutton', 'webconference'].each do |prefix|
|
10
|
+
it {
|
11
|
+
{:get => "/#{prefix}/recordings"}.
|
12
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "index")
|
13
|
+
}
|
14
|
+
it {
|
15
|
+
{:get => "/#{prefix}/recordings/rec-1/edit"}.
|
16
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "edit", :id => "rec-1")
|
17
|
+
}
|
18
|
+
it {
|
19
|
+
{:get => "/#{prefix}/recordings/rec-1"}.
|
20
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "show", :id => "rec-1")
|
21
|
+
}
|
22
|
+
it {
|
23
|
+
{:put => "/#{prefix}/recordings/rec-1"}.
|
24
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "update", :id => "rec-1")
|
25
|
+
}
|
26
|
+
it {
|
27
|
+
{:delete => "/#{prefix}/recordings/rec-1"}.
|
28
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "destroy", :id => "rec-1")
|
29
|
+
}
|
30
|
+
it {
|
31
|
+
{:get => "/#{prefix}/recordings/rec-1/play?type=any"}.
|
32
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "play", :id => "rec-1")
|
33
|
+
}
|
34
|
+
it {
|
35
|
+
{:post => "/#{prefix}/recordings/rec-1/publish"}.
|
36
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "publish", :id => "rec-1")
|
37
|
+
}
|
38
|
+
it {
|
39
|
+
{:post => "/#{prefix}/recordings/rec-1/unpublish"}.
|
40
|
+
should route_to(:controller => "bigbluebutton/recordings", :action => "unpublish", :id => "rec-1")
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ActionController do
|
4
|
+
include Shoulda::Matchers::ActionController
|
5
|
+
|
6
|
+
describe "routing with :only => 'rooms'" do
|
7
|
+
|
8
|
+
it {
|
9
|
+
{:get => "/only-rooms/bigbluebutton/rooms"}.
|
10
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "index")
|
11
|
+
}
|
12
|
+
it {
|
13
|
+
{:get => "/only-rooms/bigbluebutton/rooms/new"}.
|
14
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "new")
|
15
|
+
}
|
16
|
+
it {
|
17
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1"}.
|
18
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "show", :id => "1")
|
19
|
+
}
|
20
|
+
it {
|
21
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/edit"}.
|
22
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "edit", :id => "1")
|
23
|
+
}
|
24
|
+
it {
|
25
|
+
{:put => "/only-rooms/bigbluebutton/rooms/1"}.
|
26
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "update", :id => "1")
|
27
|
+
}
|
28
|
+
it {
|
29
|
+
{:delete => "/only-rooms/bigbluebutton/rooms/1"}.
|
30
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "destroy", :id => "1")
|
31
|
+
}
|
32
|
+
it {
|
33
|
+
{:get => "/only-rooms/bigbluebutton/rooms/external"}.
|
34
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "external")
|
35
|
+
}
|
36
|
+
it {
|
37
|
+
{:post => "/only-rooms/bigbluebutton/rooms/external"}.
|
38
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "external_auth")
|
39
|
+
}
|
40
|
+
it {
|
41
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/join"}.
|
42
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "join", :id => "1")
|
43
|
+
}
|
44
|
+
it {
|
45
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/join_mobile"}.
|
46
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "join_mobile" ,:id => "1")
|
47
|
+
}
|
48
|
+
it {
|
49
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/running"}.
|
50
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "running", :id => "1")
|
51
|
+
}
|
52
|
+
it {
|
53
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/end"}.
|
54
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "end", :id => "1")
|
55
|
+
}
|
56
|
+
it {
|
57
|
+
{:get => "/only-rooms/bigbluebutton/rooms/1/invite"}.
|
58
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "invite", :id => "1")
|
59
|
+
}
|
60
|
+
it {
|
61
|
+
{:post => "/only-rooms/bigbluebutton/rooms/1/join"}.
|
62
|
+
should route_to(:controller => "bigbluebutton/rooms", :action => "auth", :id => "1")
|
63
|
+
}
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|