From 109811882665904f2080a086aca9fa163feec95a Mon Sep 17 00:00:00 2001 From: Max Melentiev Date: Wed, 16 Nov 2016 14:34:42 +0300 Subject: [PATCH] Fix integration spec for Rails 4 --- spec/telegram/bot/rspec/integration_spec.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spec/telegram/bot/rspec/integration_spec.rb b/spec/telegram/bot/rspec/integration_spec.rb index 091c43a..c456ef1 100644 --- a/spec/telegram/bot/rspec/integration_spec.rb +++ b/spec/telegram/bot/rspec/integration_spec.rb @@ -5,8 +5,17 @@ require 'action_dispatch/testing/integration' RSpec.describe 'Integrations helper', :telegram_bot do include ActionDispatch::Integration::Runner + def reset_template_assertion; end - let(:app) { Telegram::Bot::Middleware.new(bot, controller) } + let(:app) do + app = Telegram::Bot::Middleware.new(bot, controller) + if ActionPack::VERSION::MAJOR >= 5 + app + else + require 'action_dispatch/middleware/params_parser' + ActionDispatch::ParamsParser.new(app) + end + end let(:bot) { Telegram::Bot::ClientStub.new('token') } let(:controller_path) { '/' } let(:controller) do