Skip to content

Commit

Permalink
Fixes Apipie#622 examples not being generated for Rails < 5.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kapitonov authored and iNecas committed Oct 15, 2018
1 parent fcb7570 commit 2d23897
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/apipie/extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ class Apipie::Railtie
end
end
app.middleware.use ::Apipie::Extractor::Recorder::Middleware
ActionController::TestCase.send(:prepend, Apipie::Extractor::Recorder::FunctionalTestRecording)

if Gem::Version.new(Rails.version) < Gem::Version.new('5.0.0')
ActionController::TestCase::Behavior.instance_eval do
prepend Apipie::Extractor::Recorder::FunctionalTestRecording
end
else
ActionController::TestCase.send(:prepend, Apipie::Extractor::Recorder::FunctionalTestRecording)
end
end
end

Expand Down

0 comments on commit 2d23897

Please sign in to comment.