Add specs for api/v1/rooms_controller & api/v1/tracks_controller

and cleanup api/v1/tracks and api/v1/rooms controllers
This commit is contained in:
Nishanth Vijayan 2016-03-14 04:02:15 +05:30
parent 55cfc8ff60
commit 864245fec2
4 changed files with 77 additions and 5 deletions

View file

@ -5,12 +5,11 @@ module Api
respond_to :json
def index
if params[:conference_id].blank?
rooms = Room.all
if @conference
respond_with @conference.venue ? @conference.venue.rooms : Room.none
else
@conference.venue ? (rooms = @conference.venue.rooms) : (rooms = [])
respond_with Room.all
end
respond_with rooms
end
end
end