|
|
@@ -11,7 +11,7 @@ RSpec.describe API::V1::PokemonController, type: :controller do
|
|
|
|
|
|
describe 'DELETE #destroy' do
|
|
|
let!(:pokemon) { FactoryBot.create(:pokemon) }
|
|
|
- subject { delete :destroy, params: { id: pokemon.id } }
|
|
|
+ subject { delete :destroy, params: {id: pokemon.id} }
|
|
|
|
|
|
context 'the pokemon is successfully deleted' do
|
|
|
it 'deletes the pokemon' do
|
|
|
@@ -40,11 +40,11 @@ RSpec.describe API::V1::PokemonController, type: :controller do
|
|
|
end
|
|
|
|
|
|
describe 'POST #upload' do
|
|
|
- subject { post :upload, params: { pokemon: double } }
|
|
|
+ subject { post :upload, params: {pokemon: double} }
|
|
|
let(:client_response) { double(pokemon: [pokemon]) }
|
|
|
|
|
|
let(:pokemon) do
|
|
|
- double(pokedex_number: 10, nickname: 'pyukuchu', to_h: { pokedex_number: 10, nickname: 'pyukuchu' })
|
|
|
+ double(pokedex_number: 10, nickname: 'pyukuchu', to_h: {pokedex_number: 10, nickname: 'pyukuchu'})
|
|
|
end
|
|
|
|
|
|
before do
|
|
|
@@ -89,7 +89,7 @@ RSpec.describe API::V1::PokemonController, type: :controller do
|
|
|
describe 'GET #show' do
|
|
|
context 'the pokemon exists' do
|
|
|
let!(:pokemon) { FactoryBot.create(:pokemon) }
|
|
|
- subject { get :show, params: { id: pokemon.id }, format: :json }
|
|
|
+ subject { get :show, params: {id: pokemon.id}, format: :json }
|
|
|
|
|
|
it 'renders the pokemon JSON' do
|
|
|
subject
|