forked from External/greenlight
GRN2-129: Added server recordings and refactored adminsitrator panel (#662)
* Added server recordings and refactored adminsitrator panel * Fixed some issues * Fixed issue with owner email search * Fixed issue with edit user
This commit is contained in:
committed by
Jesus Federico
parent
8c63f793a5
commit
a055b88eb7
@ -133,420 +133,6 @@ describe Room, type: :model do
|
||||
end
|
||||
|
||||
context "#recordings" do
|
||||
it "should properly find meeting recordings" do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:get_recordings).and_return(
|
||||
recordings: [
|
||||
{
|
||||
name: "Example",
|
||||
playback: {
|
||||
format:
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
expect(@room.recordings).to contain_exactly(
|
||||
name: "Example",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
context '#filtering' do
|
||||
before do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:get_recordings).and_return(
|
||||
recordings: [
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playback: {
|
||||
format:
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "5",
|
||||
playback: {
|
||||
format:
|
||||
{
|
||||
type: "other"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
"gl-listed": "false",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "test",
|
||||
participants: "1",
|
||||
playback: {
|
||||
format:
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Exam",
|
||||
participants: "1",
|
||||
playback: {
|
||||
format:
|
||||
{
|
||||
type: "other"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
"gl-listed": "false",
|
||||
name: "z",
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should filter recordings on name" do
|
||||
expect(@room.recordings(search: "Exam")).to contain_exactly(
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "5",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "other"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "false",
|
||||
}
|
||||
},
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it "should filter recordings on participants" do
|
||||
expect(@room.recordings(search: "5")).to contain_exactly(
|
||||
name: "aExamaaa",
|
||||
participants: "5",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "other"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "false",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it "should filter recordings on format" do
|
||||
expect(@room.recordings(search: "presentation")).to contain_exactly(
|
||||
{
|
||||
name: "test",
|
||||
participants: "1",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it "should filter recordings on visibility" do
|
||||
expect(@room.recordings(search: "public")).to contain_exactly(
|
||||
{
|
||||
name: "test",
|
||||
participants: "1",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
},
|
||||
},
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "presentation"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
it "should filter recordings on metadata name by default" do
|
||||
expect(@room.recordings(search: "z")).to contain_exactly(
|
||||
name: "Exam",
|
||||
participants: "1",
|
||||
playbacks:
|
||||
[
|
||||
{
|
||||
type: "other"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "false",
|
||||
name: "z",
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context '#sorting' do
|
||||
before do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:get_recordings).and_return(
|
||||
recordings: [
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playback: {
|
||||
format: {
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playback: {
|
||||
format: {
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should sort recordings on name" do
|
||||
expect(@room.recordings(column: "name", direction: "asc")).to eq(
|
||||
[
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks: [
|
||||
{
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playbacks: [
|
||||
{
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should sort recordings on participants" do
|
||||
expect(@room.recordings(column: "users", direction: "desc")).to eq(
|
||||
[
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks: [
|
||||
{
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playbacks: [
|
||||
{
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should sort recordings on visibility" do
|
||||
expect(@room.recordings(column: "visibility", direction: "desc")).to eq(
|
||||
[
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks: [
|
||||
{
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playbacks: [
|
||||
{
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should sort recordings on length" do
|
||||
expect(@room.recordings(column: "length", direction: "asc")).to eq(
|
||||
[
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playbacks: [
|
||||
{
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks: [
|
||||
{
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
|
||||
it "should sort recordings on format" do
|
||||
expect(@room.recordings(column: "formats", direction: "desc")).to eq(
|
||||
[
|
||||
{
|
||||
name: "Example",
|
||||
participants: "3",
|
||||
playbacks: [
|
||||
{
|
||||
type: "presentation",
|
||||
length: "4"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
"gl-listed": "true",
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "aExamaaa",
|
||||
participants: "1",
|
||||
playbacks: [
|
||||
{
|
||||
type: "other",
|
||||
length: "3"
|
||||
}
|
||||
],
|
||||
metadata: {
|
||||
name: "Z",
|
||||
"gl-listed": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it "deletes the recording" do
|
||||
allow_any_instance_of(BigBlueButton::BigBlueButtonApi).to receive(:delete_recordings).and_return(
|
||||
returncode: true, deleted: true
|
||||
|
Reference in New Issue
Block a user