Create symbolic link using REST API #852
This commit is contained in:
parent
f3dda76879
commit
3d3e909176
@ -148,7 +148,7 @@ class DmsfLinksController < ApplicationController
|
||||
end
|
||||
end
|
||||
}
|
||||
format.api { result ? render_api_ok : render_validation_errors(@dmsf_link) }
|
||||
format.api { render_validation_errors(@dmsf_link) unless result }
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
4
app/views/dmsf_links/create.api.rsb
Normal file
4
app/views/dmsf_links/create.api.rsb
Normal file
@ -0,0 +1,4 @@
|
||||
api.dmsf_link do
|
||||
api.id @dmsf_link.id
|
||||
api.title @dmsf_link.title
|
||||
end
|
||||
@ -63,6 +63,12 @@ class DmsfLinkApiTest < RedmineDmsf::Test::IntegrationTest
|
||||
}
|
||||
post "/dmsf_links.xml?key=#{token.value}", payload, {'CONTENT_TYPE' => 'application/xml'}
|
||||
assert_response :success
|
||||
# <?xml version="1.0" encoding="UTF-8"?>
|
||||
# <dmsf_link>
|
||||
# <id>1243</id>
|
||||
# <title>test</title>
|
||||
# </dmsf_link>
|
||||
assert_select 'dmsf_link > title', :text => name
|
||||
assert_equal 1, DmsfLink.where(:name => name, :project_id => @project1.id).count
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user