summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/etag_caching/router_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/etag_caching/router_spec.rb')
-rw-r--r--spec/lib/gitlab/etag_caching/router_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/lib/gitlab/etag_caching/router_spec.rb b/spec/lib/gitlab/etag_caching/router_spec.rb
index 5ae4a19263c..fd95e090e76 100644
--- a/spec/lib/gitlab/etag_caching/router_spec.rb
+++ b/spec/lib/gitlab/etag_caching/router_spec.rb
@@ -67,6 +67,17 @@ describe Gitlab::EtagCaching::Router do
expect(result.name).to eq 'merge_request_pipelines'
end
+ it 'matches build endpoint' do
+ env = build_env(
+ '/my-group/my-project/builds/234.json'
+ )
+
+ result = described_class.match(env)
+
+ expect(result).to be_present
+ expect(result.name).to eq 'project_build'
+ end
+
it 'does not match blob with confusing name' do
env = build_env(
'/my-group/my-project/blob/master/pipelines.json'
@@ -77,6 +88,32 @@ describe Gitlab::EtagCaching::Router do
expect(result).to be_blank
end
+<<<<<<< HEAD
+ it 'matches pipeline#show endpoint' do
+ env = build_env(
+ '/my-group/my-project/pipelines/2.json'
+=======
+ it 'matches the environments path' do
+ env = build_env(
+ '/my-group/my-project/environments.json'
+>>>>>>> ebede2b... Use etag caching for environments JSON
+ )
+
+ result = described_class.match(env)
+
+<<<<<<< HEAD
+<<<<<<< HEAD
+ expect(result).to be_present
+ expect(result.name).to eq 'project_pipeline'
+=======
+ expect(result).to be_blank
+>>>>>>> ebede2b... Use etag caching for environments JSON
+=======
+ expect(result).to be_present
+ expect(result.name).to eq 'environments'
+>>>>>>> 3be9820... Test etag caching router and incorporate review
+ end
+
def build_env(path)
{ 'PATH_INFO' => path }
end