diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-08-14 13:50:56 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2014-05-07 02:58:48 +0200 |
commit | 592d37d72f85037ce41ea58f9f930e608ec338f8 (patch) | |
tree | 7616c258d8925e4f1b5bb739e81053ec717e1dee /test | |
parent | ce1773461b71a40afb406f4148b32aad11b52a57 (diff) | |
download | ecs2-592d37d72f85037ce41ea58f9f930e608ec338f8.tar.gz ecs2-592d37d72f85037ce41ea58f9f930e608ec338f8.zip |
New resource /sys/configs
Every participant could GET and POST to this resource.
A GET might show this:
curl ... -H 'Content-Type: application/json' \
-X GET https://ecs.host.com/sys/configs
{
"participant_events": "true",
"resource_events": {
"/campusconnect/glossaries": true,
"/campusconnect/course_urls": true,
"/campusconnect/course_members": true,
"/campusconnect/wikis": true,
"/campusconnect/directory_trees": true,
"/campusconnect/learningmodules": true,
"/campusconnect/groups": true,
"/campusconnect/categories": true,
"/campusconnect/courselinks": true,
"/campusconnect/organisation_units": true,
"/campusconnect/files": true,
"/campusconnect/terms": true,
"/campusconnect/courses": true,
"/sys/auths": false
},
"selfrouting": "false"
}
Only if participant_events and the appropriate resource_events are true,
you will get an event.
It's also possible to set the two attributes participant_events and
selfrouting. Just make a POST such as:
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"participant_events":true}' https://ecs.host.com/sys/configs
or
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"selfrouting":false}' https://ecs.host.com/sys/configs
or
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"selfrouting":false, "participant_events":true}' \
https://ecs.host.com/sys/configs
As you see, just set the attribute you want to set and make a POST.
You don't have to provide a receiver header, because the receiver is
implicitely the ECS.
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/configs_controller_test.rb | 8 | ||||
-rw-r--r-- | test/unit/helpers/configs_helper_test.rb | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/configs_controller_test.rb b/test/functional/configs_controller_test.rb new file mode 100644 index 0000000..049e561 --- /dev/null +++ b/test/functional/configs_controller_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class ConfigsControllerTest < ActionController::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end diff --git a/test/unit/helpers/configs_helper_test.rb b/test/unit/helpers/configs_helper_test.rb new file mode 100644 index 0000000..4a0c42a --- /dev/null +++ b/test/unit/helpers/configs_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class ConfigsHelperTest < ActionView::TestCase +end |