2019-12-04 20:38:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
require 'fast_spec_helper'
|
2018-03-27 19:54:05 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Middleware::ReleaseEnv do
|
2018-03-27 19:54:05 +05:30
|
|
|
let(:inner_app) { double(:app, call: 'yay') }
|
|
|
|
let(:app) { described_class.new(inner_app) }
|
|
|
|
let(:env) { { 'action_controller.instance' => 'something' } }
|
|
|
|
|
|
|
|
describe '#call' do
|
|
|
|
it 'calls the app and clears the env' do
|
|
|
|
result = app.call(env)
|
|
|
|
|
|
|
|
expect(result).to eq('yay')
|
|
|
|
expect(env).to be_empty
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|