* VRFS-215: changing path of REST API to match our /api/
This commit is contained in:
parent
6f0888a43e
commit
686790cab8
|
|
@ -39,9 +39,6 @@ SampleApp::Application.routes.draw do
|
|||
match '/reset_password_token' => 'users#reset_password_token', :via => :get
|
||||
match '/reset_password_complete' => 'users#reset_password_complete', :via => :post
|
||||
|
||||
# version check for JamClient
|
||||
match '/versioncheck' => 'artifacts#versioncheck'
|
||||
|
||||
scope '/api' do
|
||||
# music sessions
|
||||
match '/sessions/:id/participants' => 'api_music_sessions#participant_create', :via => :post
|
||||
|
|
@ -195,5 +192,8 @@ SampleApp::Application.routes.draw do
|
|||
match '/recordings/upload_sign' => 'api_recordings_controller#upload_sign', :via => :get
|
||||
match '/recordings/upload_part_complete' => 'api_recordings_controller#upload_part_complete', :via => :put
|
||||
match '/recordings/upload_complete' => 'api_recordings_controller#upload_complete', :via => :put
|
||||
|
||||
# version check for JamClient
|
||||
match '/versioncheck' => 'artifacts#versioncheck'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,21 +12,21 @@ describe "Artifact API ", :type => :api do
|
|||
end
|
||||
|
||||
it "matches an artifact" do
|
||||
get '/versioncheck.json', { :os=>'Win32', :product=>'JamClient'}
|
||||
get '/api/versioncheck.json', { :os=>'Win32', :product=>'JamClient'}
|
||||
last_response.status.should eql(200)
|
||||
JSON.parse(last_response.body).should eql({ "version" => @artifact.version, "uri" => @artifact.uri})
|
||||
end
|
||||
|
||||
it "matches no artifact" do
|
||||
@artifact.delete
|
||||
get '/versioncheck.json', { :os=>'Win32', :product=>'JamClient'}
|
||||
get '/api/versioncheck.json', { :os=>'Win32', :product=>'JamClient'}
|
||||
last_response.status.should eql(200)
|
||||
JSON.parse(last_response.body).should eql({})
|
||||
end
|
||||
|
||||
it "fails on bad product" do
|
||||
@artifact.delete
|
||||
get '/versioncheck.json', { :os=>'what', :product=>'JamClient'}
|
||||
get '/api/versioncheck.json', { :os=>'what', :product=>'JamClient'}
|
||||
last_response.status.should eql(422)
|
||||
JSON.parse(last_response.body).should eql({ "errors" => {"product" => ['not a valid product']}})
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue