Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
13f017f0
Commit
13f017f0
authored
Jun 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user model specs
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
8daa69a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
47 deletions
+11
-47
spec/models/user_spec.rb
spec/models/user_spec.rb
+11
-47
No files found.
spec/models/user_spec.rb
View file @
13f017f0
...
...
@@ -241,18 +241,8 @@ describe User do
it
{
user
.
first_name
.
should
==
'John'
}
end
describe
'without defaults'
do
let
(
:user
)
{
User
.
new
}
it
"should not apply defaults to user"
do
user
.
projects_limit
.
should
==
10
user
.
can_create_group
.
should
be_true
user
.
theme_id
.
should
==
Gitlab
::
Theme
::
BASIC
end
end
context
'as admin'
do
describe
'with defaults'
do
let
(
:user
)
{
User
.
build_user
({},
as: :admin
)
}
let
(
:user
)
{
User
.
new
}
it
"should apply defaults to user"
do
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
...
...
@@ -262,42 +252,16 @@ describe User do
end
describe
'with default overrides'
do
let
(
:user
)
{
User
.
build_user
({
projects_limit:
123
,
can_create_group:
true
,
can_create_team:
true
,
theme_id:
Gitlab
::
Theme
::
BASIC
},
as: :admin
)
}
let
(
:user
)
{
User
.
new
(
projects_limit:
123
,
can_create_group:
false
,
can_create_team:
true
,
theme_id:
Gitlab
::
Theme
::
BASIC
)
}
it
"should apply defaults to user"
do
Gitlab
.
config
.
gitlab
.
default_projects_limit
.
should_not
==
123
Gitlab
.
config
.
gitlab
.
default_can_create_group
.
should_not
be_true
Gitlab
.
config
.
gitlab
.
default_theme
.
should_not
==
Gitlab
::
Theme
::
BASIC
user
.
projects_limit
.
should
==
123
user
.
can_create_group
.
should
be_tru
e
user
.
can_create_group
.
should
be_fals
e
user
.
theme_id
.
should
==
Gitlab
::
Theme
::
BASIC
end
end
end
context
'as user'
do
describe
'with defaults'
do
let
(
:user
)
{
User
.
build_user
}
it
"should apply defaults to user"
do
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
user
.
theme_id
.
should
==
Gitlab
.
config
.
gitlab
.
default_theme
end
end
describe
'with default overrides'
do
let
(
:user
)
{
User
.
build_user
(
projects_limit:
123
,
can_create_group:
true
,
theme_id:
Gitlab
::
Theme
::
BASIC
)
}
it
"should apply defaults to user"
do
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
user
.
theme_id
.
should
==
Gitlab
.
config
.
gitlab
.
default_theme
end
end
end
end
describe
'search'
do
let
(
:user1
)
{
create
(
:user
,
username:
'James'
,
email:
'james@testing.com'
)
}
let
(
:user2
)
{
create
(
:user
,
username:
'jameson'
,
email:
'jameson@example.com'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment