Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
b4d89299
Commit
b4d89299
authored
May 09, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finishing pending applications specs
parent
c34fadbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
3 deletions
+42
-3
noahapp_application_spec.rb
spec/noahapp_application_spec.rb
+42
-3
No files found.
spec/noahapp_application_spec.rb
View file @
b4d89299
...
...
@@ -75,11 +75,26 @@ describe "Using the Application API", :reset_redis => false do
Noah
::
Application
.
find
(
:name
=>
@appdata
[
:name
]).
size
.
should
==
1
Noah
::
Application
.
find
(
:name
=>
@appdata
[
:name
]).
first
.
is_new?
.
should
==
true
end
it
"new application with new configuration should work"
it
"new application with new configuration should work"
do
post_json
=
'{"body":"awesome_string","format":"string"}'
put
"/applications/my_awesome_app/configurations/my_awesome_config"
,
post_json
,
"CONTENT_TYPE"
=>
"application/json"
last_response
.
should
be_ok
response
=
last_response
.
should
return_json
response
[
"result"
].
should
==
"success"
response
[
"id"
].
nil?
.
should
==
false
response
[
"name"
].
should
==
"my_awesome_app"
response
[
"action"
].
should
==
"create"
response
[
"configuration"
][
"action"
].
should
==
"create"
response
[
"configuration"
][
"id"
].
nil?
.
should
==
false
response
[
"configuration"
][
"item"
].
should
==
"my_awesome_config"
end
it
"new application with missing name should not work"
do
put
"/applications/should_not_work"
,
'{"foo":"bar"}'
,
"CONTENT_TYPE"
=>
"application/json"
last_response
.
should
be_invalid
end
it
"existing application should work"
do
sleep
3
...
...
@@ -93,8 +108,32 @@ describe "Using the Application API", :reset_redis => false do
Noah
::
Application
.
find
(
:name
=>
@appdata
[
:name
]).
size
.
should
==
1
Noah
::
Application
.
find
(
:name
=>
@appdata
[
:name
]).
first
.
is_new?
.
should
==
false
end
it
"existing application with new configuration"
it
"existing application with existing configuration"
it
"existing application with new configuration"
do
post_json
=
'{"body":"derp","format":"string"}'
put
"/applications/
#{
@appdata
[
:name
]
}
/configurations/herp"
,
post_json
,
"CONTENT_TYPE"
=>
"application/json"
last_response
.
should
be_ok
response
=
last_response
.
should
return_json
response
[
"result"
].
should
==
"success"
response
[
"action"
].
should
==
"update"
response
[
"configuration"
][
"action"
].
should
==
"create"
response
[
"configuration"
][
"id"
].
nil?
.
should
==
false
response
[
"configuration"
][
"item"
].
should
==
"herp"
end
it
"existing application with existing configuration"
do
post_json
=
'{"body":"derp","format":"string"}'
put
"/applications/
#{
@appdata
[
:name
]
}
/configurations/herp"
,
post_json
,
"CONTENT_TYPE"
=>
"application/json"
sleep
3
put
"/applications/
#{
@appdata
[
:name
]
}
/configurations/herp"
,
post_json
,
"CONTENT_TYPE"
=>
"application/json"
last_response
.
should
be_ok
response
=
last_response
.
should
return_json
response
[
"result"
].
should
==
"success"
response
[
"action"
].
should
==
"update"
response
[
"configuration"
][
"action"
].
should
==
"update"
response
[
"configuration"
][
"id"
].
nil?
.
should
==
false
response
[
"configuration"
][
"item"
].
should
==
"herp"
end
end
describe
"DELETE"
do
...
...
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