Skip to content

Commit

Permalink
Merge pull request #28 from concertmate/testing/concert
Browse files Browse the repository at this point in the history
Testing for Concert
  • Loading branch information
GBowman1 authored Sep 19, 2024
2 parents bb9830e + 52f0642 commit 2b9a349
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/requests/api/v1/ticketmaster_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,19 @@
expect(ticket_m_details[:data][:attributes][:concert_date]).to eq("2024-10-01")
end
end

it 'returns an error if there is no concerts for that person' do
get '/api/v1/concerts', params: { artist: 'ArtistThatDoesntExist' }

expect(response).to_not be_successful
expect(response.status).to eq(404)

error = JSON.parse(response.body, symbolize_names: true)

# require 'pry'; binding.pry
expect(error).to have_key(:error)
expect(error[:error]).to be_a(String)
expect(error[:error]).to eq('No concerts found')
end

end

0 comments on commit 2b9a349

Please sign in to comment.