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
ceeea4f5
Commit
ceeea4f5
authored
8 years ago
by
Lucas Gabriel Lima
Browse files
Options
Downloads
Patches
Plain Diff
created tests for tagging learning objects
parent
0a9b7a68
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/controllers/v1/learning_objects_controller_test.rb
+49
-0
49 additions, 0 deletions
test/controllers/v1/learning_objects_controller_test.rb
with
49 additions
and
0 deletions
test/controllers/v1/learning_objects_controller_test.rb
0 → 100644
+
49
−
0
View file @
ceeea4f5
require
'test_helper'
class
V1::LearningObjectsControllerTest
<
ActionController
::
TestCase
tests
V1
::
LearningObjectsController
include
Devise
::
TestHelpers
test
'should user tagging a learning object'
do
auth_request
users
(
:jack
)
tag
=
tags
(
:tag_three
).
name
post
:tagging
,
id:
learning_objects
(
:user_lo
).
id
,
tag:
{
name:
tag
,
owner_id:
users
(
:jack
).
id
,
owner_type:
'User'
}
p
learning_objects
(
:user_lo
).
errors
.
full_messages
assert_response
:created
end
test
'should user untagging a learning object'
do
auth_request
users
(
:jack
)
tag
=
tags
(
:tag_three
).
name
post
:untagging
,
id:
learning_objects
(
:user_lo
).
id
,
tag:
{
name:
tag
,
owner_id:
users
(
:jack
).
id
,
owner_type:
'User'
}
assert_response
:ok
end
test
'should institution tagging a learning object'
do
auth_request
users
(
:jack
)
institution
=
institutions
(
:ufpr
)
institution
.
users
<<
users
(
:jack
)
tag
=
tags
(
:tag_one
).
name
post
:tagging
,
id:
learning_objects
(
:institution_lo
).
id
,
tag:
{
name:
tag
,
owner_id:
users
(
:jack
).
id
,
owner_type:
'User'
}
assert_response
:created
end
test
'should institution untagging a learning object'
do
auth_request
users
(
:jack
)
institution
=
institutions
(
:ufpr
)
institution
.
users
<<
users
(
:jack
)
tag
=
tags
(
:tag_one
).
name
post
:untagging
,
id:
learning_objects
(
:institution_lo
).
id
,
tag:
{
name:
tag
,
owner_id:
users
(
:jack
).
id
,
owner_type:
'User'
}
assert_response
:ok
end
private
def
ensure_learning_object_is_persisted!
(
learning_object
)
learning_object
.
save!
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