test/integration/plugin_integration_test.rb in resque-web-0.0.9 vs test/integration/plugin_integration_test.rb in resque-web-0.0.10

- old
+ new

@@ -7,11 +7,15 @@ class Engine < ::Rails::Engine isolate_namespace ResqueWeb::Plugins::ResqueWebTestPlugin end class PlugintestController < ApplicationController def index - render html: "hello from test plugin", layout: true + if Rails.version >= '4.1.0' + render html: "hello from test plugin", layout: true + else + render text: "hello from test plugin", layout: true + end end end Engine.routes.draw do resources :plugintest, :only => [:index] @@ -39,10 +43,14 @@ env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials( options[:user] || user, options[:password] || password ) unless options[:auth] == false end - send(method, action, params: params, env: env) + if Rails.version >= '5.0.0' + send(method, action, params: params, env: env) + else + send(method, action, params, env) + end ENV["RESQUE_WEB_HTTP_BASIC_AUTH_USER"] = user ENV["RESQUE_WEB_HTTP_BASIC_AUTH_PASSWORD"] = password end