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