Skip to content

Commit

Permalink
adds ticket master and fixes attendee destroy controller action
Browse files Browse the repository at this point in the history
  • Loading branch information
clydeautin committed Sep 13, 2024
1 parent 0727e7a commit b6e3dbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion app/controllers/api/v1/attendees_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def create
end

def destroy
attendee = Attendee.find_by(user_id: params[:id])
attendee = Attendee.find_by(id: params[:id])

if attendee
attendee.destroy
render json: { message: 'Attendee removed successfully' }, status: :ok
Expand Down
9 changes: 5 additions & 4 deletions spec/requests/api/v1/attendee_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@
# end

it "destroys an existing attendee" do
atttendee_id = @attendee.id
attendee_id = @attendee.id

delete "/api/v1/attendees/#{attendee_id}"


delete "/api/v1/attendees/#{atttendee_id}"
expect(response).to be_successful
expect(response.status).to eq(204)
expect(response.status).to eq(200)

expect(Attendee.find_by(id: atttendee_id)).to be_nil
expect(Attendee.find_by(id: attendee_id)).to be_nil
end
end
2 changes: 1 addition & 1 deletion spec/services/ticket_master_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
events = TicketMasterService.get_events(artist)

expect(events).to be_a(Hash)
require 'pry'; binding.pry

end
end
end

0 comments on commit b6e3dbc

Please sign in to comment.