v3: consisten nameing
This commit is contained in:
parent
a3a9f1282a
commit
9b8a99ea33
|
@ -30,7 +30,7 @@ module Travis::API::V3
|
||||||
list = resources[resource.identifier][service] ||= []
|
list = resources[resource.identifier][service] ||= []
|
||||||
pattern = sub_route ? resource.route + sub_route : resource.route
|
pattern = sub_route ? resource.route + sub_route : resource.route
|
||||||
pattern.to_templates.each do |template|
|
pattern.to_templates.each do |template|
|
||||||
list << { 'request-method'.freeze => request_method, 'uri-template'.freeze => prefix + template }
|
list << { 'request_method'.freeze => request_method, 'uri_template'.freeze => prefix + template }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,22 +9,22 @@ describe Travis::API::V3::ServiceIndex do
|
||||||
describe "custom json entry point" do
|
describe "custom json entry point" do
|
||||||
let(:expected_resources) {{
|
let(:expected_resources) {{
|
||||||
"repository" => {
|
"repository" => {
|
||||||
"find" => [{"request-method"=>"GET", "uri-template"=>"#{path}repo/{repository.id}"}],
|
"find" => [{"request_method"=>"GET", "uri_template"=>"#{path}repo/{repository.id}"}],
|
||||||
"enable" => [{"request-method"=>"POST", "uri-template"=>"#{path}repo/{repository.id}/enable"}],
|
"enable" => [{"request_method"=>"POST", "uri_template"=>"#{path}repo/{repository.id}/enable"}],
|
||||||
"disable" => [{"request-method"=>"POST", "uri-template"=>"#{path}repo/{repository.id}/disable"}] },
|
"disable" => [{"request_method"=>"POST", "uri_template"=>"#{path}repo/{repository.id}/disable"}] },
|
||||||
"repositories" => {
|
"repositories" => {
|
||||||
"for_current_user" => [{"request-method"=>"GET", "uri-template"=>"#{path}repos"}] },
|
"for_current_user" => [{"request_method"=>"GET", "uri_template"=>"#{path}repos"}] },
|
||||||
"branch" => {
|
"branch" => {
|
||||||
"find" => [{"request-method"=>"GET", "uri-template"=>"#{path}repo/{repository.id}/branch/{branch.name}"}]},
|
"find" => [{"request_method"=>"GET", "uri_template"=>"#{path}repo/{repository.id}/branch/{branch.name}"}]},
|
||||||
"build" => {
|
"build" => {
|
||||||
"find" => [{"request-method"=>"GET", "uri-template"=>"#{path}build/{build.id}"}] },
|
"find" => [{"request_method"=>"GET", "uri_template"=>"#{path}build/{build.id}"}] },
|
||||||
"organizations" => {
|
"organizations" => {
|
||||||
"for_current_user" => [{"request-method"=>"GET", "uri-template"=>"#{path}orgs"}] },
|
"for_current_user" => [{"request_method"=>"GET", "uri_template"=>"#{path}orgs"}] },
|
||||||
"organization" => {
|
"organization" => {
|
||||||
"find" => [{"request-method"=>"GET", "uri-template"=>"#{path}org/{organization.id}"}] },
|
"find" => [{"request_method"=>"GET", "uri_template"=>"#{path}org/{organization.id}"}] },
|
||||||
"requests" => {
|
"requests" => {
|
||||||
"find" => [{"request-method"=>"GET", "uri-template"=>"#{path}repo/{repository.id}/requests"}],
|
"find" => [{"request_method"=>"GET", "uri_template"=>"#{path}repo/{repository.id}/requests"}],
|
||||||
"create" => [{"request-method"=>"POST", "uri-template"=>"#{path}repo/{repository.id}/requests"}]}
|
"create" => [{"request_method"=>"POST", "uri_template"=>"#{path}repo/{repository.id}/requests"}]}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
describe 'with /v3 prefix' do
|
describe 'with /v3 prefix' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user