diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-10-17 19:55:42 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-10-26 09:27:05 +0300 |
commit | 52fa309e86d1bafc6b8a986d8bd74fd906b1ebc9 (patch) | |
tree | 879d8ed6fb6646d1a642a24460f03f6409fb0bd3 /spec/lib/gitlab/patch | |
parent | f1701c0fec096184a5908df65187573209dd6254 (diff) |
Extract EE only oauth routes and add tests
Diffstat (limited to 'spec/lib/gitlab/patch')
-rw-r--r-- | spec/lib/gitlab/patch/draw_route_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/lib/gitlab/patch/draw_route_spec.rb b/spec/lib/gitlab/patch/draw_route_spec.rb new file mode 100644 index 00000000000..4009b903dc3 --- /dev/null +++ b/spec/lib/gitlab/patch/draw_route_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'fast_spec_helper' + +describe Gitlab::Patch::DrawRoute do + subject do + Class.new do + include Gitlab::Patch::DrawRoute + + def route_path(route_name) + File.expand_path("../../../../#{route_name}", __dir__) + end + end.new + end + + before do + allow(subject).to receive(:instance_eval) + end + + it 'evaluates CE only route' do + subject.draw(:help) + + expect(subject).to have_received(:instance_eval) + .with(File.read(subject.route_path('config/routes/help.rb'))) + .once + + expect(subject).to have_received(:instance_eval) + .once + end +end |