rename path helper

pull/2536/head
Jan Sandbrink 10 years ago
parent 1c997eb423
commit aecc8b6aee
  1. 12
      lib/api/v3/utilities/path_helper.rb
  2. 2
      lib/api/v3/work_packages/work_package_representer.rb
  3. 4
      spec/lib/api/v3/utilities/path_helper_spec.rb

@ -104,10 +104,6 @@ module API
render_markup(format: :textile, link: link)
end
def self.schema(project_id, type_id)
"#{root}/work_packages/schemas/#{project_id}-#{type_id}"
end
def self.statuses
"#{root}/statuses"
end
@ -160,6 +156,10 @@ module API
"#{work_package(id)}/activities"
end
def self.work_package_form(id)
"#{work_package(id)}/form"
end
def self.work_package_relations(id)
"#{work_package(id)}/relations"
end
@ -168,8 +168,8 @@ module API
"#{work_package_relations(work_package_id)}/#{id}"
end
def self.work_package_form(id)
"#{work_package(id)}/form"
def self.work_package_schema(project_id, type_id)
"#{root}/work_packages/schemas/#{project_id}-#{type_id}"
end
def self.work_package_watchers(id)

@ -46,7 +46,7 @@ module API
link :schema do
{
href: api_v3_paths.schema(represented.project.id, represented.type.id)
href: api_v3_paths.work_package_schema(represented.project.id, represented.type.id)
}
end

@ -204,8 +204,8 @@ describe ::API::V3::Utilities::PathHelper do
end
describe 'schemas paths' do
describe '#schema' do
subject { helper.schema 1, 2 }
describe '#work_package_schema' do
subject { helper.work_package_schema 1, 2 }
it_behaves_like 'api v3 path'

Loading…
Cancel
Save