Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
luciagirasoles committed Dec 5, 2022
1 parent 6dccb2b commit a4495ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/controllers/api/events_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,20 @@
end
end

describe 'GET #past_by_month' do
describe 'GET #by_month' do
before do
Meetup.create(title: 'August event', location: 'virtual', date: DateTime.new(2021, 8, 1))
end

it 'returns one event for a given month' do
get :past_by_month, params: { year: '2021', month: '8' }
get :by_month, params: { year: '2021', month: '8' }
expect(response).to have_http_status(200)
body = JSON.parse(response.body)
expect(body['data']['title']).to eq('August event')
expect(body['data'][0]['title']).to eq('August event')
end

it 'returns a 404 when no event exists for that month' do
get :past_by_month, params: { year: '2021', month: '11' }
get :by_month, params: { year: '2021', month: '11' }
expect(response).to have_http_status(404)
end
end
Expand Down

0 comments on commit a4495ad

Please sign in to comment.