Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
ac226e2c
Commit
ac226e2c
authored
7 years ago
by
Clarissa
Browse files
Options
Downloads
Patches
Plain Diff
#228: Download to documentation; with status 302
parent
4a652755
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/acceptance/downloads_spec.rb
+28
-0
28 additions, 0 deletions
spec/acceptance/downloads_spec.rb
spec/factories/attachments.rb
+10
-0
10 additions, 0 deletions
spec/factories/attachments.rb
with
38 additions
and
0 deletions
spec/acceptance/downloads_spec.rb
0 → 100644
+
28
−
0
View file @
ac226e2c
require
'acceptance_helpers'
require
'shared/contexts'
resource
'Downloads'
do
explanation
"An user can download the content of a learning object or collection."
get
'/v1/:type/:id/download'
do
include_context
"authenticate_user"
parameter
:type
,
"Represents the type of object [‘learning_objects’,'collections']"
,
scope: :download
parameter
:id
,
"The id of object"
,
scope: :download
let
(
:type
)
{
'learning_objects'
}
let
(
:id
)
{
@learning_object
.
id
}
before
do
@learning_object
=
create
(
:learning_object
,
publisher:
@user
)
create
(
:attachment
,
learning_object:
@learning_object
)
end
example_request
'Download an object'
do
expect
(
status
).
to
eq
(
302
)
end
end
end
This diff is collapsed.
Click to expand it.
spec/factories/attachments.rb
0 → 100644
+
10
−
0
View file @
ac226e2c
FactoryGirl
.
define
do
factory
:attachment
,
class:
LearningObject
::
Attachment
do
|
f
|
f
.
name
{
Faker
::
Name
.
name
}
f
.
retrieve_link
{
Faker
::
File
.
file_name
}
f
.
mime_type
{
Faker
::
File
.
mime_type
}
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment