mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Update active_model_serializers.Fix conference serializer and api tests
The controllers are not using the serializers, because of a bug in active_model_serializer. Hence the update.API tests are fixed to work with the new API response structure. Fixes bugs in conference serializer.
This commit is contained in:
parent
d2cfb56ea5
commit
3da04c0f7c
4 changed files with 39 additions and 35 deletions
|
|
@ -6,12 +6,12 @@ describe Api::V1::RoomsController do
|
|||
let!(:conference_room) { create(:room, name: 'Conference Room', venue: venue) }
|
||||
let!(:room) { create(:room, name: 'Test Room') }
|
||||
|
||||
context 'GET #index' do
|
||||
describe 'GET #index' do
|
||||
context 'without conference scope' do
|
||||
it 'returns all rooms' do
|
||||
|
||||
get :index, format: :json
|
||||
json = JSON.parse(response.body)
|
||||
json = JSON.parse(response.body)['rooms']
|
||||
|
||||
expect(response).to be_success
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ describe Api::V1::RoomsController do
|
|||
it 'returns all rooms of conference' do
|
||||
|
||||
get :index, conference_id: conference.short_title, format: :json
|
||||
json = JSON.parse(response.body)
|
||||
json = JSON.parse(response.body)['rooms']
|
||||
|
||||
expect(response).to be_success
|
||||
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ describe Api::V1::TracksController do
|
|||
let!(:conference_track) { create(:track, name: 'Conference Track', program_id: conference.program.id) }
|
||||
let!(:track) { create(:track, name: 'Test Track') }
|
||||
|
||||
context 'GET #index' do
|
||||
describe 'GET #index' do
|
||||
context 'without conference scope' do
|
||||
it 'returns all tracks' do
|
||||
|
||||
get :index, format: :json
|
||||
json = JSON.parse(response.body)
|
||||
json = JSON.parse(response.body)['tracks']
|
||||
|
||||
expect(response).to be_success
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ describe Api::V1::TracksController do
|
|||
it 'returns all rooms of conference' do
|
||||
|
||||
get :index, conference_id: conference.short_title, format: :json
|
||||
json = JSON.parse(response.body)
|
||||
json = JSON.parse(response.body)['tracks']
|
||||
|
||||
expect(response).to be_success
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue