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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
ea636ebb
Commit
ea636ebb
authored
Jun 14, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'rs-expect-syntax-specs' into 'master'
Prepare specs for RSpec 3 See merge request !811
parents
0b3c9742
37066267
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
72 additions
and
74 deletions
+72
-74
spec/controllers/autocomplete_controller_spec.rb
spec/controllers/autocomplete_controller_spec.rb
+8
-8
spec/features/admin/admin_hooks_spec.rb
spec/features/admin/admin_hooks_spec.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+2
-2
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+17
-17
spec/features/search_spec.rb
spec/features/search_spec.rb
+1
-1
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+3
-3
spec/lib/gitlab/o_auth/auth_hash_spec.rb
spec/lib/gitlab/o_auth/auth_hash_spec.rb
+7
-7
spec/models/external_wiki_service_spec.rb
spec/models/external_wiki_service_spec.rb
+1
-1
spec/models/project_services/irker_service_spec.rb
spec/models/project_services/irker_service_spec.rb
+5
-5
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+4
-4
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+3
-3
spec/requests/api/milestones_spec.rb
spec/requests/api/milestones_spec.rb
+3
-3
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+3
-3
spec/services/destroy_group_service_spec.rb
spec/services/destroy_group_service_spec.rb
+6
-6
spec/services/projects/destroy_service_spec.rb
spec/services/projects/destroy_service_spec.rb
+6
-6
spec/services/projects/transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+2
-4
No files found.
spec/controllers/autocomplete_controller_spec.rb
View file @
ea636ebb
...
@@ -15,9 +15,9 @@ describe AutocompleteController do
...
@@ -15,9 +15,9 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
body
.
should
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
body
.
size
.
should
eq
(
1
)
}
it
{
expect
(
body
.
size
).
to
eq
(
1
)
}
it
{
body
.
first
[
"username"
].
should
==
user
.
username
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
end
end
context
'group members'
do
context
'group members'
do
...
@@ -32,9 +32,9 @@ describe AutocompleteController do
...
@@ -32,9 +32,9 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
body
.
should
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
body
.
size
.
should
eq
(
1
)
}
it
{
expect
(
body
.
size
).
to
eq
(
1
)
}
it
{
body
.
first
[
"username"
].
should
==
user
.
username
}
it
{
expect
(
body
.
first
[
"username"
]).
to
eq
user
.
username
}
end
end
context
'all users'
do
context
'all users'
do
...
@@ -45,7 +45,7 @@ describe AutocompleteController do
...
@@ -45,7 +45,7 @@ describe AutocompleteController do
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
let
(
:body
)
{
JSON
.
parse
(
response
.
body
)
}
it
{
body
.
should
be_kind_of
(
Array
)
}
it
{
expect
(
body
).
to
be_kind_of
(
Array
)
}
it
{
body
.
size
.
should
eq
(
User
.
count
)
}
it
{
expect
(
body
.
size
).
to
eq
(
User
.
count
)
}
end
end
end
end
spec/features/admin/admin_hooks_spec.rb
View file @
ea636ebb
...
@@ -12,7 +12,7 @@ describe "Admin::Hooks", feature: true do
...
@@ -12,7 +12,7 @@ describe "Admin::Hooks", feature: true do
describe
"GET /admin/hooks"
do
describe
"GET /admin/hooks"
do
it
"should be ok"
do
it
"should be ok"
do
visit
admin_root_path
visit
admin_root_path
within
".sidebar-wrapper"
do
page
.
within
".sidebar-wrapper"
do
click_on
"Hooks"
click_on
"Hooks"
end
end
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
expect
(
current_path
).
to
eq
(
admin_hooks_path
)
...
...
spec/features/issues_spec.rb
View file @
ea636ebb
...
@@ -311,10 +311,10 @@ describe 'Issues', feature: true do
...
@@ -311,10 +311,10 @@ describe 'Issues', feature: true do
end
end
def
first_issue
def
first_issue
all
(
'ul.issues-list li'
).
first
.
text
page
.
all
(
'ul.issues-list li'
).
first
.
text
end
end
def
last_issue
def
last_issue
all
(
'ul.issues-list li'
).
last
.
text
page
.
all
(
'ul.issues-list li'
).
last
.
text
end
end
end
end
spec/features/notes_on_merge_requests_spec.rb
View file @
ea636ebb
...
@@ -22,20 +22,20 @@ describe 'Comments' do
...
@@ -22,20 +22,20 @@ describe 'Comments' do
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
is_expected
.
to
have_css
(
'.js-main-target-form'
,
visible:
true
,
count:
1
)
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
expect
(
find
(
'.js-main-target-form input[type=submit]'
).
value
).
to
eq
(
'Add Comment'
)
to
eq
(
'Add Comment'
)
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_link
(
'Cancel'
)
expect
(
page
).
not_to
have_link
(
'Cancel'
)
end
end
end
end
describe
'with text'
do
describe
'with text'
do
before
do
before
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'This is awesome'
fill_in
'note[note]'
,
with:
'This is awesome'
end
end
end
end
it
'should have enable submit button and preview button'
do
it
'should have enable submit button and preview button'
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
not_to
have_css
(
'.js-comment-button[disabled]'
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
expect
(
page
).
to
have_css
(
'.js-md-preview-button'
,
visible:
true
)
end
end
...
@@ -45,7 +45,7 @@ describe 'Comments' do
...
@@ -45,7 +45,7 @@ describe 'Comments' do
describe
'when posting a note'
do
describe
'when posting a note'
do
before
do
before
do
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
fill_in
'note[note]'
,
with:
'This is awsome!'
fill_in
'note[note]'
,
with:
'This is awsome!'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
click_button
'Add Comment'
click_button
'Add Comment'
...
@@ -54,11 +54,11 @@ describe 'Comments' do
...
@@ -54,11 +54,11 @@ describe 'Comments' do
it
'should be added and form reset'
do
it
'should be added and form reset'
do
is_expected
.
to
have_content
(
'This is awsome!'
)
is_expected
.
to
have_content
(
'This is awsome!'
)
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
expect
(
page
).
to
have_no_field
(
'note[note]'
,
with:
'This is awesome!'
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible: :hidden
)
expect
(
page
).
to
have_css
(
'.js-md-preview'
,
visible: :hidden
)
end
end
within
(
'.js-main-target-form'
)
do
page
.
within
(
'.js-main-target-form'
)
do
is_expected
.
to
have_css
(
'.js-note-text'
,
visible:
true
)
is_expected
.
to
have_css
(
'.js-note-text'
,
visible:
true
)
end
end
end
end
...
@@ -66,7 +66,7 @@ describe 'Comments' do
...
@@ -66,7 +66,7 @@ describe 'Comments' do
describe
'when editing a note'
,
js:
true
do
describe
'when editing a note'
,
js:
true
do
it
'should contain the hidden edit form'
do
it
'should contain the hidden edit form'
do
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
is_expected
.
to
have_css
(
'.note-edit-form'
,
visible:
false
)
end
end
end
end
...
@@ -78,7 +78,7 @@ describe 'Comments' do
...
@@ -78,7 +78,7 @@ describe 'Comments' do
end
end
it
'should show the note edit form and hide the note body'
do
it
'should show the note edit form and hide the note body'
do
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.current-note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
'.note-edit-form'
,
visible:
true
)).
to
be_visible
expect
(
find
(
:css
,
'.note-body > .note-text'
,
visible:
false
)).
not_to
be_visible
expect
(
find
(
:css
,
'.note-body > .note-text'
,
visible:
false
)).
not_to
be_visible
...
@@ -90,17 +90,17 @@ describe 'Comments' do
...
@@ -90,17 +90,17 @@ describe 'Comments' do
#within(".current-note-edit-form") do
#within(".current-note-edit-form") do
#fill_in "note[note]", with: "Some new content"
#fill_in "note[note]", with: "Some new content"
#find(".btn-cancel").click
#find(".btn-cancel").click
#
find(".js-note-text", visible: false).text.should ==
note.note
#
expect(find(".js-note-text", visible: false).text).to eq
note.note
#end
#end
#end
#end
it
'appends the edited at time to the note'
do
it
'appends the edited at time to the note'
do
within
(
'.current-note-edit-form'
)
do
page
.
within
(
'.current-note-edit-form'
)
do
fill_in
'note[note]'
,
with:
'Some new content'
fill_in
'note[note]'
,
with:
'Some new content'
find
(
'.btn-save'
).
click
find
(
'.btn-save'
).
click
end
end
within
(
"#note_
#{
note
.
id
}
"
)
do
page
.
within
(
"#note_
#{
note
.
id
}
"
)
do
is_expected
.
to
have_css
(
'.note_edited_ago'
)
is_expected
.
to
have_css
(
'.note_edited_ago'
)
expect
(
find
(
'.note_edited_ago'
).
text
).
expect
(
find
(
'.note_edited_ago'
).
text
).
to
match
(
/less than a minute ago/
)
to
match
(
/less than a minute ago/
)
...
@@ -115,7 +115,7 @@ describe 'Comments' do
...
@@ -115,7 +115,7 @@ describe 'Comments' do
end
end
it
'shows the delete link'
do
it
'shows the delete link'
do
within
(
'.note-attachment'
)
do
page
.
within
(
'.note-attachment'
)
do
is_expected
.
to
have_css
(
'.js-note-attachment-delete'
)
is_expected
.
to
have_css
(
'.js-note-attachment-delete'
)
end
end
end
end
...
@@ -150,7 +150,7 @@ describe 'Comments' do
...
@@ -150,7 +150,7 @@ describe 'Comments' do
it
{
is_expected
.
to
have_css
(
'.js-temp-notes-holder'
)
}
it
{
is_expected
.
to
have_css
(
'.js-temp-notes-holder'
)
}
it
'has .new_note css class'
do
it
'has .new_note css class'
do
within
(
'.js-temp-notes-holder'
)
do
page
.
within
(
'.js-temp-notes-holder'
)
do
expect
(
subject
).
to
have_css
(
'.new_note'
)
expect
(
subject
).
to
have_css
(
'.new_note'
)
end
end
end
end
...
@@ -166,7 +166,7 @@ describe 'Comments' do
...
@@ -166,7 +166,7 @@ describe 'Comments' do
end
end
it
'should be removed when canceled'
do
it
'should be removed when canceled'
do
within
(
".diff-file form[rel$='
#{
line_code
}
']"
)
do
page
.
within
(
".diff-file form[rel$='
#{
line_code
}
']"
)
do
find
(
'.js-close-discussion-note-form'
).
trigger
(
'click'
)
find
(
'.js-close-discussion-note-form'
).
trigger
(
'click'
)
end
end
...
@@ -186,11 +186,11 @@ describe 'Comments' do
...
@@ -186,11 +186,11 @@ describe 'Comments' do
describe
'previewing them separately'
do
describe
'previewing them separately'
do
before
do
before
do
# add two separate texts and trigger previews on both
# add two separate texts and trigger previews on both
within
(
"tr[id='
#{
line_code
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'One comment on line 7'
fill_in
'note[note]'
,
with:
'One comment on line 7'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'Another comment on line 10'
fill_in
'note[note]'
,
with:
'Another comment on line 10'
find
(
'.js-md-preview-button'
).
click
find
(
'.js-md-preview-button'
).
click
end
end
...
@@ -199,7 +199,7 @@ describe 'Comments' do
...
@@ -199,7 +199,7 @@ describe 'Comments' do
describe
'posting a note'
do
describe
'posting a note'
do
before
do
before
do
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
page
.
within
(
"tr[id='
#{
line_code_2
}
'] + .js-temp-notes-holder"
)
do
fill_in
'note[note]'
,
with:
'Another comment on line 10'
fill_in
'note[note]'
,
with:
'Another comment on line 10'
click_button
(
'Add Comment'
)
click_button
(
'Add Comment'
)
end
end
...
...
spec/features/search_spec.rb
View file @
ea636ebb
...
@@ -7,7 +7,7 @@ describe "Search", feature: true do
...
@@ -7,7 +7,7 @@ describe "Search", feature: true do
@project
.
team
<<
[
@user
,
:reporter
]
@project
.
team
<<
[
@user
,
:reporter
]
visit
search_path
visit
search_path
within
'.search-holder'
do
page
.
within
'.search-holder'
do
fill_in
"search"
,
with:
@project
.
name
[
0
..
3
]
fill_in
"search"
,
with:
@project
.
name
[
0
..
3
]
click_button
"Search"
click_button
"Search"
end
end
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
ea636ebb
...
@@ -23,7 +23,7 @@ describe Gitlab::LDAP::Access do
...
@@ -23,7 +23,7 @@ describe Gitlab::LDAP::Access do
it
"should block user in GitLab"
do
it
"should block user in GitLab"
do
access
.
allowed?
access
.
allowed?
user
.
should
be_blocked
expect
(
user
).
to
be_blocked
end
end
end
end
...
@@ -44,7 +44,7 @@ describe Gitlab::LDAP::Access do
...
@@ -44,7 +44,7 @@ describe Gitlab::LDAP::Access do
it
"does not unblock user in GitLab"
do
it
"does not unblock user in GitLab"
do
access
.
allowed?
access
.
allowed?
user
.
should
be_blocked
expect
(
user
).
to
be_blocked
end
end
end
end
...
@@ -56,7 +56,7 @@ describe Gitlab::LDAP::Access do
...
@@ -56,7 +56,7 @@ describe Gitlab::LDAP::Access do
it
"should unblock user in GitLab"
do
it
"should unblock user in GitLab"
do
access
.
allowed?
access
.
allowed?
user
.
should_not
be_blocked
expect
(
user
).
not_to
be_blocked
end
end
end
end
end
end
...
...
spec/lib/gitlab/o_auth/auth_hash_spec.rb
View file @
ea636ebb
...
@@ -80,31 +80,31 @@ describe Gitlab::OAuth::AuthHash do
...
@@ -80,31 +80,31 @@ describe Gitlab::OAuth::AuthHash do
context
'auth_hash constructed with ASCII-8BIT encoding'
do
context
'auth_hash constructed with ASCII-8BIT encoding'
do
it
'forces utf8 encoding on uid'
do
it
'forces utf8 encoding on uid'
do
auth_hash
.
uid
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
uid
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on provider'
do
it
'forces utf8 encoding on provider'
do
auth_hash
.
provider
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
provider
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on name'
do
it
'forces utf8 encoding on name'
do
auth_hash
.
name
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
name
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on full_name'
do
it
'forces utf8 encoding on full_name'
do
auth_hash
.
full_name
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
full_name
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on username'
do
it
'forces utf8 encoding on username'
do
auth_hash
.
username
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
username
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on email'
do
it
'forces utf8 encoding on email'
do
auth_hash
.
email
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
email
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
it
'forces utf8 encoding on password'
do
it
'forces utf8 encoding on password'
do
auth_hash
.
password
.
encoding
.
should
eql
Encoding
::
UTF_8
expect
(
auth_hash
.
password
.
encoding
).
to
eql
Encoding
::
UTF_8
end
end
end
end
end
end
spec/models/external_wiki_service_spec.rb
View file @
ea636ebb
...
@@ -52,7 +52,7 @@ describe ExternalWikiService do
...
@@ -52,7 +52,7 @@ describe ExternalWikiService do
it
'should replace the wiki url'
do
it
'should replace the wiki url'
do
wiki_path
=
get_project_wiki_path
(
project
)
wiki_path
=
get_project_wiki_path
(
project
)
wiki_path
.
should
match
(
'https://gitlab.com'
)
expect
(
wiki_path
).
to
match
(
'https://gitlab.com'
)
end
end
end
end
end
end
...
...
spec/models/project_services/irker_service_spec.rb
View file @
ea636ebb
...
@@ -43,7 +43,7 @@ describe IrkerService do
...
@@ -43,7 +43,7 @@ describe IrkerService do
let
(
:_recipients
)
{
'a b c d'
}
let
(
:_recipients
)
{
'a b c d'
}
it
'should add an error if there is too many recipients'
do
it
'should add an error if there is too many recipients'
do
subject
.
send
:check_recipients_count
subject
.
send
:check_recipients_count
subject
.
errors
.
should_not
be_blank
expect
(
subject
.
errors
).
not_to
be_blank
end
end
end
end
...
@@ -51,7 +51,7 @@ describe IrkerService do
...
@@ -51,7 +51,7 @@ describe IrkerService do
let
(
:_recipients
)
{
'a b c'
}
let
(
:_recipients
)
{
'a b c'
}
it
'should not add an error if there is 3 recipients'
do
it
'should not add an error if there is 3 recipients'
do
subject
.
send
:check_recipients_count
subject
.
send
:check_recipients_count
subject
.
errors
.
should
be_blank
expect
(
subject
.
errors
).
to
be_blank
end
end
end
end
end
end
...
@@ -96,11 +96,11 @@ describe IrkerService do
...
@@ -96,11 +96,11 @@ describe IrkerService do
conn
=
@irker_server
.
accept
conn
=
@irker_server
.
accept
conn
.
readlines
.
each
do
|
line
|
conn
.
readlines
.
each
do
|
line
|
msg
=
JSON
.
load
(
line
.
chomp
(
"
\n
"
))
msg
=
JSON
.
load
(
line
.
chomp
(
"
\n
"
))
msg
.
keys
.
should
match_array
([
'to'
,
'privmsg'
])
expect
(
msg
.
keys
).
to
match_array
([
'to'
,
'privmsg'
])
if
msg
[
'to'
].
is_a?
(
String
)
if
msg
[
'to'
].
is_a?
(
String
)
msg
[
'to'
].
should
==
'irc://chat.freenode.net/#commits'
expect
(
msg
[
'to'
]).
to
eq
'irc://chat.freenode.net/#commits'
else
else
msg
[
'to'
].
should
match_array
([
'irc://chat.freenode.net/#commits'
])
expect
(
msg
[
'to'
]).
to
match_array
([
'irc://chat.freenode.net/#commits'
])
end
end
end
end
conn
.
close
conn
.
close
...
...
spec/requests/api/issues_spec.rb
View file @
ea636ebb
...
@@ -196,10 +196,10 @@ describe API::API, api: true do
...
@@ -196,10 +196,10 @@ describe API::API, api: true do
it
'should return a project issue by iid'
do
it
'should return a project issue by iid'
do
get
api
(
"/projects/
#{
project
.
id
}
/issues?iid=
#{
issue
.
iid
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/issues?iid=
#{
issue
.
iid
}
"
,
user
)
response
.
status
.
should
==
200
expect
(
response
.
status
).
to
eq
200
json_response
.
first
[
'title'
].
should
==
issue
.
title
expect
(
json_response
.
first
[
'title'
]).
to
eq
issue
.
title
json_response
.
first
[
'id'
].
should
==
issue
.
id
expect
(
json_response
.
first
[
'id'
]).
to
eq
issue
.
id
json_response
.
first
[
'iid'
].
should
==
issue
.
iid
expect
(
json_response
.
first
[
'iid'
]).
to
eq
issue
.
iid
end
end
it
"should return 404 if issue id not found"
do
it
"should return 404 if issue id not found"
do
...
...
spec/requests/api/merge_requests_spec.rb
View file @
ea636ebb
...
@@ -118,9 +118,9 @@ describe API::API, api: true do
...
@@ -118,9 +118,9 @@ describe API::API, api: true do
it
'should return merge_request by iid'
do
it
'should return merge_request by iid'
do
url
=
"/projects/
#{
project
.
id
}
/merge_requests?iid=
#{
merge_request
.
iid
}
"
url
=
"/projects/
#{
project
.
id
}
/merge_requests?iid=
#{
merge_request
.
iid
}
"
get
api
(
url
,
user
)
get
api
(
url
,
user
)
response
.
status
.
should
==
200
expect
(
response
.
status
).
to
eq
200
json_response
.
first
[
'title'
].
should
==
merge_request
.
title
expect
(
json_response
.
first
[
'title'
]).
to
eq
merge_request
.
title
json_response
.
first
[
'id'
].
should
==
merge_request
.
id
expect
(
json_response
.
first
[
'id'
]).
to
eq
merge_request
.
id
end
end
it
"should return a 404 error if merge_request_id not found"
do
it
"should return a 404 error if merge_request_id not found"
do
...
...
spec/requests/api/milestones_spec.rb
View file @
ea636ebb
...
@@ -32,9 +32,9 @@ describe API::API, api: true do
...
@@ -32,9 +32,9 @@ describe API::API, api: true do
it
'should return a project milestone by iid'
do
it
'should return a project milestone by iid'
do
get
api
(
"/projects/
#{
project
.
id
}
/milestones?iid=
#{
milestone
.
iid
}
"
,
user
)
get
api
(
"/projects/
#{
project
.
id
}
/milestones?iid=
#{
milestone
.
iid
}
"
,
user
)
response
.
status
.
should
==
200
expect
(
response
.
status
).
to
eq
200
json_response
.
first
[
'title'
].
should
==
milestone
.
title
expect
(
json_response
.
first
[
'title'
]).
to
eq
milestone
.
title
json_response
.
first
[
'id'
].
should
==
milestone
.
id
expect
(
json_response
.
first
[
'id'
]).
to
eq
milestone
.
id
end
end
it
'should return 401 error if user not authenticated'
do
it
'should return 401 error if user not authenticated'
do
...
...
spec/requests/api/projects_spec.rb
View file @
ea636ebb
...
@@ -60,9 +60,9 @@ describe API::API, api: true do
...
@@ -60,9 +60,9 @@ describe API::API, api: true do
it
'should include the project labels as the tag_list'
do
it
'should include the project labels as the tag_list'
do
get
api
(
'/projects'
,
user
)
get
api
(
'/projects'
,
user
)
response
.
status
.
should
==
200
expect
(
response
.
status
).
to
eq
200
json_response
.
should
be_an
Array
expect
(
json_response
).
to
be_an
Array
json_response
.
first
.
keys
.
should
include
(
'tag_list'
)
expect
(
json_response
.
first
.
keys
).
to
include
(
'tag_list'
)
end
end
context
'and using search'
do
context
'and using search'
do
...
...
spec/services/destroy_group_service_spec.rb
View file @
ea636ebb
...
@@ -12,8 +12,8 @@ describe DestroyGroupService do
...
@@ -12,8 +12,8 @@ describe DestroyGroupService do
destroy_group
(
group
,
user
)
destroy_group
(
group
,
user
)
end
end
it
{
Group
.
all
.
should_not
include
(
group
)
}
it
{
expect
(
Group
.
all
).
not_to
include
(
group
)
}
it
{
Project
.
all
.
should_not
include
(
project
)
}
it
{
expect
(
Project
.
all
).
not_to
include
(
project
)
}
end
end
context
'file system'
do
context
'file system'
do
...
@@ -23,8 +23,8 @@ describe DestroyGroupService do
...
@@ -23,8 +23,8 @@ describe DestroyGroupService do
Sidekiq
::
Testing
.
inline!
{
destroy_group
(
group
,
user
)
}
Sidekiq
::
Testing
.
inline!
{
destroy_group
(
group
,
user
)
}
end
end
it
{
gitlab_shell
.
exists?
(
group
.
path
).
should
be_falsey
}
it
{
expect
(
gitlab_shell
.
exists?
(
group
.
path
)).
to
be_falsey
}
it
{
gitlab_shell
.
exists?
(
remove_path
).
should
be_falsey
}
it
{
expect
(
gitlab_shell
.
exists?
(
remove_path
)).
to
be_falsey
}
end
end
context
'Sidekiq fake'
do
context
'Sidekiq fake'
do
...
@@ -33,8 +33,8 @@ describe DestroyGroupService do
...
@@ -33,8 +33,8 @@ describe DestroyGroupService do
Sidekiq
::
Testing
.
fake!
{
destroy_group
(
group
,
user
)
}
Sidekiq
::
Testing
.
fake!
{
destroy_group
(
group
,
user
)
}
end
end
it
{
gitlab_shell
.
exists?
(
group
.
path
).
should
be_falsey
}
it
{
expect
(
gitlab_shell
.
exists?
(
group
.
path
)).
to
be_falsey
}
it
{
gitlab_shell
.
exists?
(
remove_path
).
should
be_truthy
}
it
{
expect
(
gitlab_shell
.
exists?
(
remove_path
)).
to
be_truthy
}
end
end
end
end
...
...
spec/services/projects/destroy_service_spec.rb
View file @
ea636ebb
...
@@ -12,9 +12,9 @@ describe Projects::DestroyService do
...
@@ -12,9 +12,9 @@ describe Projects::DestroyService do
Sidekiq
::
Testing
.
inline!
{
destroy_project
(
project
,
user
,
{})
}
Sidekiq
::
Testing
.
inline!
{
destroy_project
(
project
,
user
,
{})
}
end
end
it
{
Project
.
all
.
should_not
include
(
project
)
}
it
{
expect
(
Project
.
all
).
not_to
include
(
project
)
}
it
{
Dir
.
exists?
(
path
).
should
be_falsey
}
it
{
expect
(
Dir
.
exists?
(
path
)).
to
be_falsey
}
it
{
Dir
.
exists?
(
remove_path
).
should
be_falsey
}
it
{
expect
(
Dir
.
exists?
(
remove_path
)).
to
be_falsey
}
end
end
context
'Sidekiq fake'
do
context
'Sidekiq fake'
do
...
@@ -23,9 +23,9 @@ describe Projects::DestroyService do
...
@@ -23,9 +23,9 @@ describe Projects::DestroyService do
Sidekiq
::
Testing
.
fake!
{
destroy_project
(
project
,
user
,
{})
}
Sidekiq
::
Testing
.
fake!
{
destroy_project
(
project
,
user
,
{})
}
end
end
it
{
Project
.
all
.
should_not
include
(
project
)
}
it
{
expect
(
Project
.
all
).
not_to
include
(
project
)
}
it
{
Dir
.
exists?
(
path
).
should
be_falsey
}
it
{
expect
(
Dir
.
exists?
(
path
)).
to
be_falsey
}
it
{
Dir
.
exists?
(
remove_path
).
should
be_truthy
}
it
{
expect
(
Dir
.
exists?
(
remove_path
)).
to
be_truthy
}
end
end
def
destroy_project
(
project
,
user
,
params
)
def
destroy_project
(
project
,
user
,
params
)
...
...
spec/services/projects/transfer_service_spec.rb
View file @
ea636ebb
...
@@ -20,8 +20,7 @@ describe Projects::TransferService do
...
@@ -20,8 +20,7 @@ describe Projects::TransferService do
@result
=
transfer_project
(
project
,
user
,
new_namespace_id:
nil
)
@result
=
transfer_project
(
project
,
user
,
new_namespace_id:
nil
)
end
end
it
{
expect
(
@result
).
not_to
be_nil
}
# { result.should be_false } passes on nil
it
{
expect
(
@result
).
to
eq
false
}
it
{
expect
(
@result
).
to
be_falsey
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
end
end
...
@@ -30,8 +29,7 @@ describe Projects::TransferService do
...
@@ -30,8 +29,7 @@ describe Projects::TransferService do
@result
=
transfer_project
(
project
,
user
,
new_namespace_id:
group
.
id
)
@result
=
transfer_project
(
project
,
user
,
new_namespace_id:
group
.
id
)
end
end
it
{
expect
(
@result
).
not_to
be_nil
}
# { result.should be_false } passes on nil
it
{
expect
(
@result
).
to
eq
false
}
it
{
expect
(
@result
).
to
be_falsey
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
it
{
expect
(
project
.
namespace
).
to
eq
(
user
.
namespace
)
}
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