bigbluebutton_rails 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +11 -0
- data/Gemfile.lock +1 -1
- data/README.rdoc +46 -32
- data/Rakefile +0 -1
- data/app/controllers/bigbluebutton/rooms_controller.rb +17 -16
- data/app/controllers/bigbluebutton/servers_controller.rb +6 -2
- data/app/models/bigbluebutton_room.rb +35 -1
- data/app/models/bigbluebutton_server.rb +1 -1
- data/app/views/bigbluebutton/rooms/_form.html.erb +7 -3
- data/app/views/bigbluebutton/rooms/_rooms.html.erb +37 -0
- data/app/views/bigbluebutton/rooms/edit.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/external.html.erb +2 -1
- data/app/views/bigbluebutton/rooms/index.html.erb +2 -37
- data/app/views/bigbluebutton/rooms/invite.html.erb +2 -2
- data/app/views/bigbluebutton/rooms/join.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/new.html.erb +1 -1
- data/app/views/bigbluebutton/rooms/show.html.erb +10 -4
- data/app/views/bigbluebutton/servers/_activity_list.html.erb +6 -6
- data/app/views/bigbluebutton/servers/index.html.erb +4 -3
- data/app/views/bigbluebutton/servers/rooms.html.erb +2 -0
- data/app/views/bigbluebutton/servers/show.html.erb +3 -4
- data/config/locales/en.yml +7 -3
- data/lib/bigbluebutton_rails/exceptions.rb +4 -0
- data/lib/bigbluebutton_rails/rails/routes.rb +28 -35
- data/lib/bigbluebutton_rails/version.rb +1 -1
- data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +13 -10
- data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +13 -13
- data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +114 -115
- data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +12 -1
- data/spec/controllers/bigbluebutton/servers_controller_spec.rb +11 -0
- data/spec/generators/install_generator_spec.rb +1 -1
- data/spec/models/bigbluebutton_room_spec.rb +166 -80
- data/spec/models/bigbluebutton_server_spec.rb +4 -4
- data/spec/rails_app/features/activity_monitor_servers.feature +6 -0
- data/spec/rails_app/features/create_rooms.feature +5 -0
- data/spec/rails_app/features/create_servers.feature +7 -2
- data/spec/rails_app/features/edit_rooms.feature +7 -0
- data/spec/rails_app/features/edit_servers.feature +8 -2
- data/spec/rails_app/features/join_rooms.feature +1 -0
- data/spec/rails_app/features/list_and_show_rooms.feature +10 -2
- data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +10 -10
- data/spec/rails_app/features/step_definitions/common_steps.rb +6 -4
- data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +1 -0
- data/spec/rails_app/features/step_definitions/join_mobile_steps.rb +1 -3
- data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +3 -7
- data/spec/rails_app/features/step_definitions/list_and_show_rooms_steps.rb +12 -5
- data/spec/rails_app/features/step_definitions/list_and_show_servers_steps.rb +1 -5
- data/spec/rails_app/features/support/{application_controller.rb → patches/application_controller.rb} +0 -0
- data/spec/rails_app/features/support/patches/bigbluebutton_room.rb +9 -0
- data/spec/rails_app/features/support/paths.rb +12 -10
- data/spec/rails_app/features/support/templates.rb +90 -46
- data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +38 -22
- data/spec/routing/bigbluebutton/rooms_routing_spec.rb +142 -58
- data/spec/routing/bigbluebutton/servers_routing_spec.rb +9 -1
- metadata +11 -8
@@ -2,6 +2,11 @@ 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
|
+
|
5
10
|
Scenario: Register a new BigBlueButton room
|
6
11
|
Given a real server
|
7
12
|
When the user goes to the new room page
|
@@ -2,13 +2,18 @@ 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:
|
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
|
6
11
|
Given an anonymous user
|
7
12
|
When he goes to the new server page
|
8
13
|
And registers a new server
|
9
14
|
Then he should see the information about this server
|
10
15
|
|
11
|
-
Scenario: Try to register a
|
16
|
+
Scenario: Try to register a server with errors
|
12
17
|
Given an anonymous user
|
13
18
|
When he goes to the new server page
|
14
19
|
And registers a new server with a wrong URL
|
@@ -2,6 +2,13 @@ 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
|
+
|
5
12
|
Scenario: Edit data in a BigBlueButton room
|
6
13
|
Given an anonymous user
|
7
14
|
And a real server
|
@@ -2,7 +2,13 @@ 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:
|
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
|
6
12
|
Given an anonymous user
|
7
13
|
And a real server
|
8
14
|
When he goes to the edit server page
|
@@ -11,7 +17,7 @@ Feature: Edit webconference servers
|
|
11
17
|
Then he should be at the show server URL
|
12
18
|
And the server URL should be "http://test.com/bigbluebutton/api"
|
13
19
|
|
14
|
-
Scenario: Try to edit data in a
|
20
|
+
Scenario: Try to edit data in a server with incorrect values
|
15
21
|
Given an anonymous user
|
16
22
|
And a real server
|
17
23
|
When he goes to the edit server page
|
@@ -35,6 +35,7 @@ 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
|
38
39
|
|
39
40
|
@mechanize
|
40
41
|
Scenario: Joining a private room as a moderator
|
@@ -3,16 +3,24 @@ 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
|
6
|
+
Scenario: View the list of 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
|
13
|
+
Scenario: View all information of a 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,
|
8
|
-
|
7
|
+
BigBlueButtonBot.new(@server.api, room.meetingid, msalt, 1,
|
8
|
+
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,
|
20
|
-
|
19
|
+
BigBlueButtonBot.new(@server.api, room.meetingid, msalt, 1,
|
20
|
+
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 =>
|
80
|
-
method.call("a", { :href =>
|
81
|
-
method.call("a", { :href =>
|
82
|
-
method.call("a", { :href =>
|
83
|
-
method.call("a", { :href =>
|
84
|
-
method.call("a", { :href =>
|
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) })
|
85
85
|
|
86
86
|
room.fetch_is_running?
|
87
87
|
if room.is_running?
|
@@ -5,7 +5,6 @@ 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
|
9
8
|
count.to_i.times do
|
10
9
|
Factory.create(:bigbluebutton_server)
|
11
10
|
end
|
@@ -41,14 +40,17 @@ end
|
|
41
40
|
When /(?:|I ) go(es)? to the (.+) page( \(no view check\))?$/i do |_, page_name, not_check|
|
42
41
|
case page_name
|
43
42
|
when /join external room/i
|
44
|
-
@params = { :meeting => @room.meetingid }
|
43
|
+
@params = { :meeting => @room.meetingid, :server_id => @server.id }
|
45
44
|
end
|
46
45
|
visit path_to(page_name, @params)
|
47
|
-
check_template(page_name) if not_check.nil?
|
48
46
|
end
|
49
47
|
|
50
48
|
When /see the (.+) page$/i do |page_name|
|
51
|
-
|
49
|
+
opts = {
|
50
|
+
:room => @room, :server => @server,
|
51
|
+
:rooms => BigbluebuttonRoom.all, :servers => BigbluebuttonServer.all
|
52
|
+
}
|
53
|
+
check_template(page_name, opts)
|
52
54
|
end
|
53
55
|
|
54
56
|
When /a user named "(.+)"/i do |username|
|
@@ -1,5 +1,6 @@
|
|
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])
|
3
4
|
fill_in("bigbluebutton_room[name]", :with => attrs[:name])
|
4
5
|
fill_in("bigbluebutton_room[meetingid]", :with => attrs[:meetingid])
|
5
6
|
check("bigbluebutton_room[randomize_meetingid]") if attrs[:randomize_meetingid]
|
@@ -1,17 +1,13 @@
|
|
1
1
|
When /^he should see a form to join the external room$/i do
|
2
|
-
|
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
|
2
|
+
check_template("join external room")
|
7
3
|
end
|
8
4
|
|
9
5
|
When /^he should see his name in the user name input$/i do
|
10
6
|
case current_url
|
11
7
|
when /\/invite$/ # normal rooms
|
12
|
-
form = form_selector(
|
8
|
+
form = form_selector(join_bigbluebutton_room_path(@room), 'post')
|
13
9
|
when /\/external(\?.*)?/ # external rooms
|
14
|
-
form = form_selector(
|
10
|
+
form = form_selector(external_bigbluebutton_rooms_path, 'post')
|
15
11
|
end
|
16
12
|
within(form) do
|
17
13
|
has_element("input", { :name => 'user[name]', :type => 'text', :value => @user.name })
|
@@ -1,11 +1,18 @@
|
|
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?
|
4
2
|
check_template("rooms index")
|
5
3
|
end
|
6
4
|
|
7
5
|
When /^he should see all the information available for this room$/i do
|
8
|
-
|
9
|
-
|
10
|
-
|
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 })
|
11
18
|
end
|
@@ -1,11 +1,7 @@
|
|
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?
|
4
2
|
check_template("servers index")
|
5
3
|
end
|
6
4
|
|
7
5
|
When /^he should see all the information available for this server$/i do
|
8
|
-
|
9
|
-
# any better ideas?
|
10
|
-
check_template("show server")
|
6
|
+
check_template("show server", { :server => @server })
|
11
7
|
end
|
data/spec/rails_app/features/support/{application_controller.rb → patches/application_controller.rb}
RENAMED
File without changes
|
@@ -6,7 +6,7 @@ module NavigationHelpers
|
|
6
6
|
# step definition in web_steps.rb
|
7
7
|
#
|
8
8
|
def path_to(page_name, params=nil)
|
9
|
-
params = "?" + params.map{ |k,v| "#{k}=#{CGI::escape(v)}" }.join("&") if params
|
9
|
+
params = "?" + params.map{ |k,v| "#{k}=#{CGI::escape(v.to_s)}" }.join("&") if params
|
10
10
|
|
11
11
|
case page_name
|
12
12
|
|
@@ -24,24 +24,26 @@ module NavigationHelpers
|
|
24
24
|
p = bigbluebutton_server_path(@server)
|
25
25
|
when /server activity monitor/i
|
26
26
|
p = activity_bigbluebutton_server_path(@server)
|
27
|
+
when /server rooms/i
|
28
|
+
p = rooms_bigbluebutton_server_path(@server)
|
27
29
|
when /new room/i
|
28
|
-
p =
|
30
|
+
p = new_bigbluebutton_room_path
|
29
31
|
when /rooms index/i, /create room/i
|
30
|
-
p =
|
32
|
+
p = bigbluebutton_rooms_path
|
31
33
|
when /join external room/i
|
32
|
-
p =
|
34
|
+
p = external_bigbluebutton_rooms_path
|
33
35
|
when /show room/i
|
34
|
-
p =
|
36
|
+
p = bigbluebutton_room_path(@room)
|
35
37
|
when /edit room/i
|
36
|
-
p =
|
38
|
+
p = edit_bigbluebutton_room_path(@room)
|
37
39
|
when /update room/i
|
38
|
-
p =
|
40
|
+
p = bigbluebutton_room_path(@room)
|
39
41
|
when /join room/i
|
40
|
-
p =
|
42
|
+
p = join_bigbluebutton_room_path(@room)
|
41
43
|
when /invite room/i
|
42
|
-
p =
|
44
|
+
p = invite_bigbluebutton_room_path(@room)
|
43
45
|
when /mobile join/i
|
44
|
-
p =
|
46
|
+
p = join_mobile_bigbluebutton_room_path(@room)
|
45
47
|
|
46
48
|
else
|
47
49
|
begin
|
@@ -2,26 +2,27 @@
|
|
2
2
|
module TemplateHelpers
|
3
3
|
|
4
4
|
# calls the specific methods that verify the template for each page
|
5
|
-
def check_template(page_name)
|
6
|
-
|
7
|
-
|
8
|
-
self.send(method)
|
9
|
-
rescue NoMethodError
|
5
|
+
def check_template(page_name, options={})
|
6
|
+
method = ("check " + page_name).split(" ").join('_').to_sym
|
7
|
+
unless self.respond_to?(method)
|
10
8
|
raise "Can't find method to check the template for \"#{page_name}\"\n" +
|
11
|
-
"Now, go and add the method \"#{method}\" in #{__FILE__}"
|
9
|
+
"Now, go and add the method \"#{method}(options)\" in #{__FILE__}"
|
12
10
|
end
|
11
|
+
self.send(method, options)
|
13
12
|
end
|
14
13
|
|
15
14
|
# servers/new
|
16
|
-
def check_new_server
|
15
|
+
def check_new_server(options)
|
17
16
|
within(form_selector(bigbluebutton_servers_path, 'post')) do
|
18
17
|
check_server_form
|
19
18
|
end
|
20
19
|
end
|
21
20
|
|
22
21
|
# server/:id/edit
|
23
|
-
def check_edit_server
|
24
|
-
|
22
|
+
def check_edit_server(options)
|
23
|
+
server = options[:server] || BigbluebuttonServer.last
|
24
|
+
|
25
|
+
within(form_selector(bigbluebutton_server_path(server), 'post')) do
|
25
26
|
check_server_form
|
26
27
|
end
|
27
28
|
end
|
@@ -46,29 +47,29 @@ module TemplateHelpers
|
|
46
47
|
has_element("input", { :name => 'commit', :type => 'submit' })
|
47
48
|
end
|
48
49
|
|
49
|
-
# servers/new
|
50
|
-
def check_new_room
|
51
|
-
within(form_selector(bigbluebutton_server_rooms_path(@server), 'post')) do
|
52
|
-
check_room_form
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
50
|
# server/:id/show
|
57
|
-
def check_show_server
|
58
|
-
server = BigbluebuttonServer.last
|
51
|
+
def check_show_server(options)
|
52
|
+
server = options[:server] || BigbluebuttonServer.last
|
53
|
+
|
59
54
|
page_has_content(server.name)
|
60
55
|
page_has_content(server.url)
|
61
56
|
page_has_content(server.salt)
|
62
57
|
page_has_content(server.version)
|
63
58
|
page_has_content(server.param)
|
64
|
-
has_element("a", { :href =>
|
59
|
+
has_element("a", { :href => edit_bigbluebutton_server_path(server) }) # edit
|
60
|
+
has_element("a", { :href => activity_bigbluebutton_server_path(server) }) # activity
|
61
|
+
has_element("a", { :href => rooms_bigbluebutton_server_path(server) }) # rooms
|
62
|
+
has_element("a", { :href => bigbluebutton_server_path(server), :"data-method" => 'delete' }) # destroy
|
65
63
|
end
|
66
64
|
|
67
65
|
# servers/
|
68
|
-
def check_servers_index
|
66
|
+
def check_servers_index(options)
|
67
|
+
servers = options[:severs] || BigbluebuttonServer.all
|
68
|
+
|
69
69
|
has_element("a", { :href => new_bigbluebutton_server_path }) # new server link
|
70
|
+
has_element("a", { :href => bigbluebutton_rooms_path }) # rooms list
|
70
71
|
n = 1
|
71
|
-
|
72
|
+
servers.each do |server|
|
72
73
|
within(make_selector("ul#bbbrails_servers_list>li:nth(#{n})")) do
|
73
74
|
# server data
|
74
75
|
has_content(server.name)
|
@@ -79,7 +80,7 @@ module TemplateHelpers
|
|
79
80
|
has_content(server.url)
|
80
81
|
# action links
|
81
82
|
has_element("a", { :href => bigbluebutton_server_path(server) }) # show
|
82
|
-
has_element("a", { :href =>
|
83
|
+
has_element("a", { :href => rooms_bigbluebutton_server_path(server) }) # rooms
|
83
84
|
has_element("a", { :href => activity_bigbluebutton_server_path(server) }) # activity
|
84
85
|
has_element("a", { :href => edit_bigbluebutton_server_path(server) }) # edit
|
85
86
|
has_element("a", { :href => bigbluebutton_server_path(server), :"data-method" => 'delete' }) # destroy
|
@@ -89,28 +90,47 @@ module TemplateHelpers
|
|
89
90
|
end
|
90
91
|
|
91
92
|
# servers/:id/activity
|
92
|
-
def check_server_activity_monitor
|
93
|
+
def check_server_activity_monitor(options)
|
94
|
+
server = options[:server] || BigbluebuttonServer.last
|
95
|
+
|
93
96
|
# checks only the 'skeleton', the content depends on the rooms currently running
|
97
|
+
# and is not checked here
|
94
98
|
within(make_selector("div.bbbrails_countdown")) do
|
95
99
|
has_element("span.bbbrails_countdown_value")
|
96
100
|
has_element("a.bbbrails_refresh_now",
|
97
|
-
{ :href => activity_bigbluebutton_server_path(
|
101
|
+
{ :href => activity_bigbluebutton_server_path(server) })
|
98
102
|
end
|
99
103
|
has_element("div#bbbrails_server_activity_meetings")
|
100
104
|
end
|
101
105
|
|
106
|
+
# servers/:id/rooms
|
107
|
+
def check_server_rooms(options)
|
108
|
+
check_rooms_index(options)
|
109
|
+
end
|
110
|
+
|
102
111
|
|
103
112
|
|
104
113
|
|
114
|
+
# rooms/new
|
115
|
+
def check_new_room(options)
|
116
|
+
within(form_selector(bigbluebutton_rooms_path, 'post')) do
|
117
|
+
check_room_form
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
105
121
|
# room/:id/edit
|
106
|
-
def check_edit_room
|
107
|
-
|
122
|
+
def check_edit_room(options)
|
123
|
+
room = options[:room] || BigbluebuttonRoom.last
|
124
|
+
|
125
|
+
within(form_selector(bigbluebutton_room_path(room), 'post')) do
|
108
126
|
check_room_form
|
109
127
|
end
|
110
128
|
end
|
111
129
|
|
112
130
|
# internal form in rooms/new and room/:id/edit
|
113
131
|
def check_room_form
|
132
|
+
has_element("input#bigbluebutton_room_server_id",
|
133
|
+
{ :name => 'bigbluebutton_room[server_id]', :type => 'text' })
|
114
134
|
has_element("input#bigbluebutton_room_name",
|
115
135
|
{ :name => 'bigbluebutton_room[name]', :type => 'text' })
|
116
136
|
has_element("input#bigbluebutton_room_meetingid",
|
@@ -154,8 +174,10 @@ module TemplateHelpers
|
|
154
174
|
end
|
155
175
|
|
156
176
|
# room/:id/show
|
157
|
-
def check_show_room
|
158
|
-
room = BigbluebuttonRoom.last
|
177
|
+
def check_show_room(options)
|
178
|
+
room = options[:room] || BigbluebuttonRoom.last
|
179
|
+
|
180
|
+
page_has_content(room.server_id)
|
159
181
|
page_has_content(room.name)
|
160
182
|
page_has_content(room.meetingid)
|
161
183
|
page_has_content(room.randomize_meetingid)
|
@@ -169,12 +191,23 @@ module TemplateHelpers
|
|
169
191
|
page_has_content(room.max_participants)
|
170
192
|
page_has_content(room.external)
|
171
193
|
page_has_content(room.param)
|
194
|
+
# action links
|
195
|
+
has_element("a", { :href => edit_bigbluebutton_room_path(room) }) # edit
|
196
|
+
has_element("a", { :href => bigbluebutton_room_path(room) }) # show
|
197
|
+
has_element("a", { :href => join_bigbluebutton_room_path(room) }) # join
|
198
|
+
has_element("a", { :href => invite_bigbluebutton_room_path(room) }) # invite
|
199
|
+
has_element("a", { :href => join_mobile_bigbluebutton_room_path(room) }) # join_mobile
|
200
|
+
has_element("a", { :href => end_bigbluebutton_room_path(room) }) # end
|
201
|
+
has_element("a", { :href => bigbluebutton_room_path(room), :"data-method" => 'delete' }) # destroy
|
172
202
|
end
|
173
203
|
|
174
204
|
# rooms/external
|
175
|
-
def check_join_external_room
|
176
|
-
|
177
|
-
|
205
|
+
def check_join_external_room(options)
|
206
|
+
room = options[:room] || BigbluebuttonRoom.last
|
207
|
+
|
208
|
+
within(form_selector(external_bigbluebutton_rooms_path, 'post')) do
|
209
|
+
has_element("input#server_id", { :name => 'server_id', :type => 'hidden', :value => room.server_id })
|
210
|
+
has_element("input#meeting", { :name => 'meeting', :type => 'hidden', :value => room.meetingid })
|
178
211
|
has_element("input#user_name", { :name => 'user[name]', :type => 'text' })
|
179
212
|
has_element("input#user_password", { :name => 'user[password]', :type => 'password' })
|
180
213
|
has_element("label", { :for => 'user_name' })
|
@@ -184,8 +217,10 @@ module TemplateHelpers
|
|
184
217
|
end
|
185
218
|
|
186
219
|
# rooms/:id/invite
|
187
|
-
def check_invite_room
|
188
|
-
|
220
|
+
def check_invite_room(options)
|
221
|
+
room = options[:room] || BigbluebuttonRoom.last
|
222
|
+
|
223
|
+
within(form_selector(join_bigbluebutton_room_path(room), 'post')) do
|
189
224
|
has_element("input#user_name", { :name => 'user[name]', :type => 'text' })
|
190
225
|
has_element("input#user_password", { :name => 'user[password]', :type => 'password' })
|
191
226
|
has_element("label", { :for => 'user_name' })
|
@@ -195,12 +230,16 @@ module TemplateHelpers
|
|
195
230
|
end
|
196
231
|
|
197
232
|
# rooms/
|
198
|
-
def check_rooms_index
|
199
|
-
|
233
|
+
def check_rooms_index(options)
|
234
|
+
rooms = options[:rooms] || BigbluebuttonRoom.all
|
235
|
+
|
236
|
+
has_element("a", { :href => new_bigbluebutton_room_path }) # new room link
|
237
|
+
has_element("a", { :href => bigbluebutton_servers_path }) # servers list
|
200
238
|
n = 1
|
201
|
-
|
239
|
+
rooms.each do |room|
|
202
240
|
within(make_selector("ul#bbbrails_rooms_list>li:nth(#{n})")) do
|
203
241
|
# room data
|
242
|
+
has_content(room.server_id) unless room.server.nil?
|
204
243
|
has_content(room.name)
|
205
244
|
has_content(room.meetingid)
|
206
245
|
has_content(room.attendee_password)
|
@@ -210,24 +249,29 @@ module TemplateHelpers
|
|
210
249
|
has_content(room.voice_bridge)
|
211
250
|
has_content(room.param)
|
212
251
|
# action links
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
has_element("a", { :href =>
|
217
|
-
has_element("a", { :href =>
|
218
|
-
has_element("a", { :href =>
|
219
|
-
has_element("a", { :href =>
|
252
|
+
unless room.server.nil?
|
253
|
+
has_element("a", { :href => bigbluebutton_server_path(room.server) }) # show server
|
254
|
+
end
|
255
|
+
has_element("a", { :href => bigbluebutton_room_path(room) }) # show
|
256
|
+
has_element("a", { :href => join_bigbluebutton_room_path(room) }) # join
|
257
|
+
has_element("a", { :href => invite_bigbluebutton_room_path(room) }) # invite
|
258
|
+
has_element("a", { :href => join_mobile_bigbluebutton_room_path(room) }) # join_mobile
|
259
|
+
has_element("a", { :href => edit_bigbluebutton_room_path(room) }) # edit
|
260
|
+
has_element("a", { :href => end_bigbluebutton_room_path(room) }) # end
|
261
|
+
has_element("a", { :href => bigbluebutton_room_path(room), :"data-method" => 'delete' }) # destroy
|
220
262
|
end
|
221
263
|
n += 1
|
222
264
|
end
|
223
265
|
end
|
224
266
|
|
225
|
-
def check_join_room # nothing to check, it only redirects to the BBB client
|
267
|
+
def check_join_room(options) # nothing to check, it only redirects to the BBB client
|
226
268
|
end
|
227
269
|
|
228
270
|
# rooms/:id/join_mobile
|
229
|
-
def check_mobile_join
|
230
|
-
|
271
|
+
def check_mobile_join(options)
|
272
|
+
room = options[:room] || BigbluebuttonRoom.last
|
273
|
+
|
274
|
+
url = join_bigbluebutton_room_url(room, :mobile => '1')
|
231
275
|
url.gsub!(/http:\/\//i, "bigbluebutton://")
|
232
276
|
has_element("a", { :href => url })
|
233
277
|
|