2019-08-22 10:57:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-01 10:48:32 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 18:09:03 +00:00
|
|
|
RSpec.describe Gitlab::Middleware::ReleaseEnv do
|
2018-03-02 16:39:42 +00:00
|
|
|
let(:inner_app) { double(:app, call: 'yay') }
|
2018-02-01 10:48:32 +00:00
|
|
|
let(:app) { described_class.new(inner_app) }
|
|
|
|
let(:env) { { 'action_controller.instance' => 'something' } }
|
|
|
|
|
|
|
|
describe '#call' do
|
2018-03-02 16:39:42 +00:00
|
|
|
it 'calls the app and clears the env' do
|
2018-02-01 10:48:32 +00:00
|
|
|
result = app.call(env)
|
|
|
|
|
|
|
|
expect(result).to eq('yay')
|
|
|
|
expect(env).to be_empty
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|