BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f9e6f668
Commit
f9e6f668
authored
Feb 05, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
parent
bdfb349f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
22 deletions
+27
-22
admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+3
-3
issues_spec.rb
spec/features/issues_spec.rb
+10
-8
merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+14
-11
No files found.
spec/features/admin/admin_users_spec.rb
View file @
f9e6f668
...
...
@@ -32,14 +32,14 @@ describe "Admin::Users", feature: true do
it
"should apply defaults to user"
do
click_button
"Create user"
user
=
User
.
last
user
=
User
.
find_by
(
username:
'bang'
)
user
.
projects_limit
.
should
==
Gitlab
.
config
.
gitlab
.
default_projects_limit
user
.
can_create_group
.
should
==
Gitlab
.
config
.
gitlab
.
default_can_create_group
end
it
"should create user with valid data"
do
click_button
"Create user"
user
=
User
.
last
user
=
User
.
find_by
(
username:
'bang'
)
user
.
name
.
should
==
"Big Bang"
user
.
email
.
should
==
"bigbang@mail.com"
end
...
...
@@ -52,7 +52,7 @@ describe "Admin::Users", feature: true do
it
"should send valid email to user with email & password"
do
click_button
"Create user"
user
=
User
.
last
user
=
User
.
find_by
(
username:
'bang'
)
email
=
ActionMailer
::
Base
.
deliveries
.
last
email
.
subject
.
should
have_content
(
"Account was created"
)
email
.
text_part
.
body
.
should
have_content
(
user
.
email
)
...
...
spec/features/issues_spec.rb
View file @
f9e6f668
require
'spec_helper'
describe
"Issues"
,
feature:
true
do
include
SortingHelper
let
(
:project
)
{
create
(
:project
)
}
before
do
...
...
@@ -80,7 +82,7 @@ describe "Issues", feature: true do
title:
title
)
end
@issue
=
Issue
.
fi
rst
# with title 'foobar'
@issue
=
Issue
.
fi
nd_by
(
title:
'foobar'
)
@issue
.
milestone
=
create
(
:milestone
,
project:
project
)
@issue
.
assignee
=
nil
@issue
.
save
...
...
@@ -130,14 +132,14 @@ describe "Issues", feature: true do
let
(
:later_due_milestone
)
{
create
(
:milestone
,
due_date:
'2013-12-12'
)
}
it
'sorts by newest'
do
visit
project_issues_path
(
project
,
sort:
'newest'
)
visit
project_issues_path
(
project
,
sort:
sort_value_recently_created
)
first_issue
.
should
include
(
"foo"
)
last_issue
.
should
include
(
"baz"
)
end
it
'sorts by oldest'
do
visit
project_issues_path
(
project
,
sort:
'oldest'
)
visit
project_issues_path
(
project
,
sort:
sort_value_oldest_created
)
first_issue
.
should
include
(
"baz"
)
last_issue
.
should
include
(
"foo"
)
...
...
@@ -146,7 +148,7 @@ describe "Issues", feature: true do
it
'sorts by most recently updated'
do
baz
.
updated_at
=
Time
.
now
+
100
baz
.
save
visit
project_issues_path
(
project
,
sort:
'recently_updated'
)
visit
project_issues_path
(
project
,
sort:
sort_value_recently_updated
)
first_issue
.
should
include
(
"baz"
)
end
...
...
@@ -154,7 +156,7 @@ describe "Issues", feature: true do
it
'sorts by least recently updated'
do
baz
.
updated_at
=
Time
.
now
-
100
baz
.
save
visit
project_issues_path
(
project
,
sort:
'last_updated'
)
visit
project_issues_path
(
project
,
sort:
sort_value_oldest_updated
)
first_issue
.
should
include
(
"baz"
)
end
...
...
@@ -168,13 +170,13 @@ describe "Issues", feature: true do
end
it
'sorts by recently due milestone'
do
visit
project_issues_path
(
project
,
sort:
'milestone_due_soon'
)
visit
project_issues_path
(
project
,
sort:
sort_value_milestone_soon
)
first_issue
.
should
include
(
"foo"
)
end
it
'sorts by least recently due milestone'
do
visit
project_issues_path
(
project
,
sort:
'milestone_due_later'
)
visit
project_issues_path
(
project
,
sort:
sort_value_milestone_later
)
first_issue
.
should
include
(
"bar"
)
end
...
...
@@ -191,7 +193,7 @@ describe "Issues", feature: true do
end
it
'sorts with a filter applied'
do
visit
project_issues_path
(
project
,
sort:
'oldest'
,
assignee_id:
user2
.
id
)
visit
project_issues_path
(
project
,
sort:
sort_value_oldest_created
,
assignee_id:
user2
.
id
)
first_issue
.
should
include
(
"bar"
)
last_issue
.
should
include
(
"foo"
)
...
...
spec/requests/api/merge_requests_spec.rb
View file @
f9e6f668
...
...
@@ -26,7 +26,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
3
json_response
.
fir
st
[
'title'
].
should
==
merge_request
.
title
json_response
.
la
st
[
'title'
].
should
==
merge_request
.
title
end
it
"should return an array of all merge_requests"
do
...
...
@@ -34,7 +34,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
3
json_response
.
fir
st
[
'title'
].
should
==
merge_request
.
title
json_response
.
la
st
[
'title'
].
should
==
merge_request
.
title
end
it
"should return an array of open merge_requests"
do
...
...
@@ -42,7 +42,7 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
1
json_response
.
fir
st
[
'title'
].
should
==
merge_request
.
title
json_response
.
la
st
[
'title'
].
should
==
merge_request
.
title
end
it
"should return an array of closed merge_requests"
do
...
...
@@ -50,8 +50,8 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
2
json_response
.
first
[
'title'
].
should
==
merge_request_closed
.
title
json_response
.
second
[
'title'
].
should
==
merge_request_merged
.
title
json_response
.
second
[
'title'
].
should
==
merge_request_closed
.
title
json_response
.
first
[
'title'
].
should
==
merge_request_merged
.
title
end
it
"should return an array of merged merge_requests"
do
...
...
@@ -73,9 +73,10 @@ describe API::API, api: true do
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
3
json_response
.
fir
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_later
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
fir
st
[
'id'
].
should
==
@mr_later
.
id
end
it
"should return an array of merge_requests in descending order"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests?sort=desc"
,
user
)
response
.
status
.
should
==
200
...
...
@@ -84,21 +85,23 @@ describe API::API, api: true do
json_response
.
first
[
'id'
].
should
==
@mr_later
.
id
json_response
.
last
[
'id'
].
should
==
@mr_earlier
.
id
end
it
"should return an array of merge_requests ordered by updated_at"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests?order_by=updated_at"
,
user
)
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
3
json_response
.
fir
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_later
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
fir
st
[
'id'
].
should
==
@mr_later
.
id
end
it
"should return an array of merge_requests ordered by created_at"
do
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests?sort=created_at"
,
user
)
response
.
status
.
should
==
200
json_response
.
should
be_an
Array
json_response
.
length
.
should
==
3
json_response
.
fir
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_later
.
id
json_response
.
la
st
[
'id'
].
should
==
@mr_earlier
.
id
json_response
.
fir
st
[
'id'
].
should
==
@mr_later
.
id
end
end
end
...
...
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