Add action TelegramBotUpdatesController#create
This commit is contained in:
parent
bc5ada2f63
commit
59f205cf3e
3 changed files with 25 additions and 0 deletions
10
app/controllers/telegram_bot_updates_controller.rb
Normal file
10
app/controllers/telegram_bot_updates_controller.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class TelegramBotUpdatesController < ApplicationController
|
||||
# POST /telegram_bot_updates
|
||||
def create
|
||||
logger.info params.inspect
|
||||
|
||||
render status: :no_content, json: {}
|
||||
end
|
||||
end
|
|
@ -20,4 +20,6 @@ Rails.application.routes.draw do
|
|||
to: 'home#post2'
|
||||
|
||||
resources :membership_applications, only: %i[new create]
|
||||
|
||||
resources :telegram_bot_updates, only: :create
|
||||
end
|
||||
|
|
13
spec/requests/telegram_bot_updates/create_spec.rb
Normal file
13
spec/requests/telegram_bot_updates/create_spec.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'POST /telegram_bot_updates' do
|
||||
before do
|
||||
post '/telegram_bot_updates'
|
||||
end
|
||||
|
||||
specify do
|
||||
expect(response).to have_http_status :no_content
|
||||
end
|
||||
end
|
Reference in a new issue