summaryrefslogtreecommitdiff
path: root/spec/routing
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2019-07-02 06:29:42 +0000
committerMarin Jankovski <marin@gitlab.com>2019-07-02 06:29:42 +0000
commitbebbb43f7133cc03c3a9944d2a4b9586a6a0d06f (patch)
tree26b96831830504d51a94240d2bb3de916f41b0ea /spec/routing
parent91820f967db8aef75d247a61f4843fb0cdf23d89 (diff)
parent114dd976426a26c19d5e2a350a2c41bda35ddf54 (diff)
downloadgitlab-ce-bebbb43f7133cc03c3a9944d2a4b9586a6a0d06f.tar.gz
Merge branch 'osw-persist-tmp-snippet-uploads' into 'master'
Persist tmp snippet uploads at users See merge request gitlab/gitlabhq!3138
Diffstat (limited to 'spec/routing')
-rw-r--r--spec/routing/uploads_routing_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/routing/uploads_routing_spec.rb b/spec/routing/uploads_routing_spec.rb
index 6a041ffdd6c..42e84774088 100644
--- a/spec/routing/uploads_routing_spec.rb
+++ b/spec/routing/uploads_routing_spec.rb
@@ -12,10 +12,19 @@ describe 'Uploads', 'routing' do
)
end
+ it 'allows creating uploads for users' do
+ expect(post('/uploads/user?id=1')).to route_to(
+ controller: 'uploads',
+ action: 'create',
+ model: 'user',
+ id: '1'
+ )
+ end
+
it 'does not allow creating uploads for other models' do
- UploadsController::MODEL_CLASSES.keys.compact.each do |model|
- next if model == 'personal_snippet'
+ unroutable_models = UploadsController::MODEL_CLASSES.keys.compact - %w(personal_snippet user)
+ unroutable_models.each do |model|
expect(post("/uploads/#{model}?id=1")).not_to be_routable
end
end