Fixed #280 Search/Paginate recordings (GRN-12) (#281)

* <Added Pagination>

* <Created search bar in Room>

* <Fixed search bar UI>

* <Fixed searching>

* <Modified search>

* <Fixed code style>

* <fixed changes>

* <Added pagination and search for public recordings>

* <added rspec tests>

* <Added and Updated search.js>

* <Fixed live searching for current user room>

* <Fixed live searching for current user room>

* <Added live search for join>

* <Fixed errors>

* <fixed gemfile>

* <Fix gems>

* <>

* <Fixed rspec tests>

* <Removed commented code>

* Update search.js
This commit is contained in:
John Ma
2018-12-06 10:24:22 -05:00
committed by Jesus Federico
parent 8b41dec8ac
commit 895af7494e
8 changed files with 97 additions and 24 deletions

View File

@ -43,6 +43,14 @@ describe RoomsController, type: :controller do
expect(assigns(:is_running)).to eql(@owner.main_room.running?)
end
it "should be able to search recordings if user is owner" do
@request.session[:user_id] = @owner.id
get :show, params: { room_uid: @owner.main_room, search: :none }
expect(assigns(:recordings)).to eql([])
end
it "should render join if user is not owner" do
@request.session[:user_id] = @user.id
@ -51,6 +59,14 @@ describe RoomsController, type: :controller do
expect(response).to render_template(:join)
end
it "should be able to search public recordings if user is not owner" do
@request.session[:user_id] = @user.id
get :show, params: { room_uid: @owner.main_room, search: :none }
expect(assigns(:recordings)).to eql(nil)
end
it "should raise if room is not valid" do
expect do
get :show, params: { room_uid: "non_existent" }