summaryrefslogtreecommitdiff
path: root/spec/controllers/concerns
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-11-03 14:59:47 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2017-11-03 14:59:47 +0100
commit0f1d6402b9ebf25d5ddd09effe6dce1902ae476b (patch)
tree49bac1361eea22526709bb777c542ce1dd39a851 /spec/controllers/concerns
parent7582bc8b4eacfe70ecc575f724285de471d6c743 (diff)
downloadgitlab-ce-0f1d6402b9ebf25d5ddd09effe6dce1902ae476b.tar.gz
Find the LFS-objects for a fork within a the fork network
Diffstat (limited to 'spec/controllers/concerns')
-rw-r--r--spec/controllers/concerns/lfs_request_spec.rb50
1 files changed, 50 insertions, 0 deletions
diff --git a/spec/controllers/concerns/lfs_request_spec.rb b/spec/controllers/concerns/lfs_request_spec.rb
new file mode 100644
index 00000000000..33b23db302a
--- /dev/null
+++ b/spec/controllers/concerns/lfs_request_spec.rb
@@ -0,0 +1,50 @@
+require 'spec_helper'
+
+describe LfsRequest do
+ include ProjectForksHelper
+
+ controller(Projects::GitHttpClientController) do
+ # `described_class` is not available in this context
+ include LfsRequest # rubocop:disable RSpec/DescribedClass
+
+ def show
+ storage_project
+
+ render nothing: true
+ end
+
+ def project
+ @project ||= Project.find(params[:id])
+ end
+
+ def download_request?
+ true
+ end
+
+ def ci?
+ false
+ end
+ end
+
+ let(:project) { create(:project, :public) }
+
+ before do
+ stub_lfs_setting(enabled: true)
+ end
+
+ describe '#storage_project' do
+ it 'assigns the project as storage project' do
+ get :show, id: project.id
+
+ expect(assigns(:storage_project)).to eq(project)
+ end
+
+ it 'assigns the source of a forked project' do
+ forked_project = fork_project(project)
+
+ get :show, id: forked_project.id
+
+ expect(assigns(:storage_project)).to eq(project)
+ end
+ end
+end