mirror of
http://ghproxy.cn/https://github.com/multunus/onemdm-server
synced 2025-12-06 02:04:57 +00:00
Change the app_usages API to accept array of data
- Add foreignkey to device for AppUsage - Rename the route to app_usage from app_usage/create
This commit is contained in:
@@ -9,12 +9,12 @@ RSpec.describe AppUsagesController, type: :controller do
|
||||
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Token.encode_credentials(device.access_token)
|
||||
end
|
||||
it "Valid params" do
|
||||
post :create, app_usage: attributes_for(:app_usage), format: :json
|
||||
post :create, app_usage: [attributes_for(:app_usage)], format: :json
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
|
||||
it "InValid Params" do
|
||||
post :create, app_usage: attributes_for(:invalid_app_usage), format: :json
|
||||
post :create, app_usage: [attributes_for(:invalid_app_usage)], format: :json
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user