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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2f884592
Commit
2f884592
authored
Sep 21, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure raise_error expectations provide arguments
parent
d4a96016
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
spec/models/ci/variable_spec.rb
spec/models/ci/variable_spec.rb
+2
-1
spec/models/ci/web_hook_spec.rb
spec/models/ci/web_hook_spec.rb
+2
-1
spec/requests/ci/api/projects_spec.rb
spec/requests/ci/api/projects_spec.rb
+2
-1
spec/services/ci/create_project_service_spec.rb
spec/services/ci/create_project_service_spec.rb
+2
-1
No files found.
spec/models/ci/variable_spec.rb
View file @
2f884592
...
@@ -38,7 +38,8 @@ describe Ci::Variable do
...
@@ -38,7 +38,8 @@ describe Ci::Variable do
it
'fails to decrypt if iv is incorrect'
do
it
'fails to decrypt if iv is incorrect'
do
subject
.
encrypted_value_iv
=
nil
subject
.
encrypted_value_iv
=
nil
subject
.
instance_variable_set
(
:@value
,
nil
)
subject
.
instance_variable_set
(
:@value
,
nil
)
expect
{
subject
.
value
}.
to
raise_error
expect
{
subject
.
value
}.
to
raise_error
(
OpenSSL
::
Cipher
::
CipherError
,
'bad decrypt'
)
end
end
end
end
end
end
spec/models/ci/web_hook_spec.rb
View file @
2f884592
...
@@ -56,7 +56,8 @@ describe Ci::WebHook do
...
@@ -56,7 +56,8 @@ describe Ci::WebHook do
it
"catches exceptions"
do
it
"catches exceptions"
do
expect
(
Ci
::
WebHook
).
to
receive
(
:post
).
and_raise
(
"Some HTTP Post error"
)
expect
(
Ci
::
WebHook
).
to
receive
(
:post
).
and_raise
(
"Some HTTP Post error"
)
expect
{
@web_hook
.
execute
(
@data
)
}.
to
raise_error
expect
{
@web_hook
.
execute
(
@data
)
}.
to
raise_error
(
RuntimeError
,
'Some HTTP Post error'
)
end
end
end
end
end
end
spec/requests/ci/api/projects_spec.rb
View file @
2f884592
...
@@ -165,7 +165,8 @@ describe Ci::API::API do
...
@@ -165,7 +165,8 @@ describe Ci::API::API do
project
.
gl_project
.
team
<<
[
user
,
:master
]
project
.
gl_project
.
team
<<
[
user
,
:master
]
delete
ci_api
(
"/projects/
#{
project
.
id
}
"
),
options
delete
ci_api
(
"/projects/
#{
project
.
id
}
"
),
options
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
{
project
.
reload
}.
to
raise_error
expect
{
project
.
reload
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
end
it
"non-manager is not authorized"
do
it
"non-manager is not authorized"
do
...
...
spec/services/ci/create_project_service_spec.rb
View file @
2f884592
...
@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do
...
@@ -15,7 +15,8 @@ describe Ci::CreateProjectService do
context
'without project dump'
do
context
'without project dump'
do
it
'should raise exception'
do
it
'should raise exception'
do
expect
{
service
.
execute
(
current_user
,
''
,
''
)
}.
to
raise_error
expect
{
service
.
execute
(
current_user
,
''
,
''
)
}.
to
raise_error
(
NoMethodError
)
end
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