forked from External/greenlight
* <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:
@ -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" }
|
||||
|
Reference in New Issue
Block a user