Sha256: 6c3369b8ded2e9c7c5fdac3920f87eca992ca366506935a8150db6f5d66901df
Contents?: true
Size: 975 Bytes
Versions: 14
Compression:
Stored size: 975 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' describe GamesController, controller: true do describe 'readme' do describe 'POST create' do it 'create game' do post '/publishers.json', params: { publisher: { name: 'Nintendo' } } publisher = JSON.parse(response.body) expect(publisher) .to eq({ 'id' => publisher['id'], 'name' => 'Nintendo' }) publisher = Publisher.last post "/publishers/#{publisher['id']}/games.json", params: { game: { name: 'Pokemon' } } game = Game.last expect(JSON.parse(response.body)) .to eq({ 'id' => game.id, 'name' => 'Pokemon', 'publisher' => { 'name' => 'Nintendo' } }) end end end end
Version data entries
14 entries across 14 versions & 1 rubygems