lib/api_spec/lib/api_spec/specs/surveys.rb in nationbuilder-rb-1.3.5 vs lib/api_spec/lib/api_spec/specs/surveys.rb in nationbuilder-rb-1.3.6
- old
+ new
@@ -1,15 +1,14 @@
class ApiSpec::Spec
endpoint 'Surveys' do |surveys|
surveys.method('Index') do |m|
+ m.synopsis = 'Shows a list of all surveys for the a site'
+ m.http_method = 'GET'
+ m.uri = '/sites/:site_slug/pages/surveys'
- m.synopsis = "Shows a list of all surveys for the a site"
- m.http_method = "GET"
- m.uri = "/sites/:site_slug/pages/surveys"
-
m.parameter('site_slug') do |p|
p.required = 'Y'
p.type = 'string'
p.description = 'the site holding the survey'
end
@@ -30,39 +29,35 @@
p.required = 'N'
p.default = '10'
p.type = 'int'
p.description = 'maximum number of results to return'
end
-
end
surveys.method('Create') do |m|
+ m.synopsis = 'Creates a survey for a site'
+ m.http_method = 'POST'
+ m.uri = '/sites/:site_slug/pages/surveys'
- m.synopsis = "Creates a survey for a site"
- m.http_method = "POST"
- m.uri = "/sites/:site_slug/pages/surveys"
-
m.parameter('site_slug') do |p|
p.required = 'Y'
p.type = 'string'
p.description = 'the site holding the survey'
end
m.parameter('body') do |p|
p.required = 'Y'
p.type = 'json'
- p.description = 'a JSON representation of the new survey'
+ p.description = 'A JSON representation of the new survey'
end
-
end
surveys.method('Update') do |m|
+ m.synopsis = 'Updates the attributes of a survey'
+ m.http_method = 'PUT'
+ m.uri = '/sites/:site_slug/pages/surveys/:id'
- m.synopsis = "Updates the attributes of a survey"
- m.http_method = "PUT"
- m.uri = "/sites/:site_slug/pages/surveys/:id"
-
m.parameter('site_slug') do |p|
p.required = 'Y'
p.type = 'string'
p.description = 'the site holding the survey'
end
@@ -76,19 +71,17 @@
m.parameter('body') do |p|
p.required = 'Y'
p.type = 'json'
p.description = 'JSON containing updates'
end
-
end
surveys.method('Destroy') do |m|
+ m.synopsis = 'Removes a survey'
+ m.http_method = 'DELETE'
+ m.uri = '/sites/:site_slug/pages/surveys/:id'
- m.synopsis = "Removes a survey"
- m.http_method = "DELETE"
- m.uri = "/sites/:site_slug/pages/surveys/:id"
-
m.parameter('site_slug') do |p|
p.required = 'Y'
p.type = 'string'
p.description = 'the site holding the survey'
end
@@ -96,11 +89,8 @@
m.parameter('id') do |p|
p.required = 'Y'
p.type = 'int'
p.description = 'the ID of the survey'
end
-
end
-
end
-
end