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
a63c7d43
Commit
a63c7d43
authored
8 years ago
by
bfs15
Browse files
Options
Downloads
Patches
Plain Diff
Added education, roles_ids, subjects to Updating a user test
parent
9d09a36c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
spec/acceptance/users_spec.rb
+10
-0
10 additions, 0 deletions
spec/acceptance/users_spec.rb
spec/factories/users.rb
+2
-0
2 additions, 0 deletions
spec/factories/users.rb
with
12 additions
and
0 deletions
spec/acceptance/users_spec.rb
+
10
−
0
View file @
a63c7d43
...
...
@@ -7,6 +7,8 @@ resource 'Users' do
before
{
12
.
times
{
create
(
:user
)
}
}
let
(
:users
)
{
User
.
all
}
let
(
:subject
)
{
Subject
.
all
}
let
(
:role
)
{
Role
.
all
}
get
'/v1/users'
do
parameter
:limit
,
'Limit of users'
...
...
@@ -83,19 +85,27 @@ resource 'Users' do
parameter
:name
,
'The name of the user'
parameter
:email
,
'The email of user'
parameter
:description
,
'The user description'
parameter
:education
,
'The user education'
parameter
:password
,
'The password of user'
parameter
:password_confirmation
,
'The password confirmation of user'
parameter
:terms_of_service
,
'Checks if user agreed with terms of service'
parameter
:avatar
,
'The user avatar'
parameter
:roles_ids
,
'The user roles'
,
scope: :user
parameter
:subjects
,
'Array with subjects ids'
,
scope: :user
let
(
:id
)
{
@user
.
id
}
let
(
:name
)
{
Faker
::
Name
.
name
}
let
(
:email
)
{
Faker
::
Internet
.
email
}
let
(
:description
)
{
Faker
::
Lorem
.
sentence
}
let
(
:education
)
{
Faker
::
Lorem
.
sentence
}
let
(
:password
)
{
'12345678'
}
let
(
:password_confirmation
)
{
'12345678'
}
let
(
:terms_of_service
)
{
true
}
let
(
:avatar
)
{
""
}
# TODO role ids con't be changed if user isn't admin, send []
# when we change so tests aren't requested by admins
let
(
:roles_ids
)
{
[
role
.
first
.
id
]
}
let
(
:subjects
)
{
[
subject
.
first
.
id
]
}
let
(
:raw_post
)
{
params
.
to_json
}
before
do
...
...
This diff is collapsed.
Click to expand it.
spec/factories/users.rb
+
2
−
0
View file @
a63c7d43
...
...
@@ -2,6 +2,8 @@ FactoryGirl.define do
factory
:user
,
aliases:
[
:owner
,
:publisher
,
:tagger
,
:followable
]
do
name
{
Faker
::
Name
.
name
}
email
{
Faker
::
Internet
.
email
}
description
{
Faker
::
Lorem
.
sentence
}
education
{
Faker
::
Lorem
.
sentence
}
password
'12345678'
confirmed_at
{
Faker
::
Date
.
between
(
2
.
years
.
ago
,
Time
.
zone
.
today
)
}
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