diff --git a/Procfile b/Procfile index e4ccbb54b0..63dc37c974 100644 --- a/Procfile +++ b/Procfile @@ -1,3 +1,4 @@ +web: bundle exec rails server -p $PORT sql: node ../CartoDB-SQL-API/app.js development tiler: node ../Windshaft-cartodb/app.js development redis: redis-server diff --git a/spec/requests/imports/uploads_spec.rb b/spec/requests/imports/uploads_spec.rb index 5d4eece479..022df4e4d9 100644 --- a/spec/requests/imports/uploads_spec.rb +++ b/spec/requests/imports/uploads_spec.rb @@ -3,34 +3,35 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe "Imports API uploads" do before(:each) do + User.all.each(&:destroy) @user = create_user(:username => 'test', :email => "client@example.com", :password => "clientex") @user.set_map_key end it 'allow to upload using the request body' do - file = File.open(Rails.root.join('spec/support/whs_features.csv'), 'r+') + file = File.open(Rails.root.join('db/fake_data/clubbing.csv'), 'r+') - post v1_imports_uploads_url(:host => 'test.localhost.lan'), {:body => file.read, :qqfile => File.basename(file.path), :api_key => @user.get_map_key} + post v1_uploads_url(:host => 'test.localhost.lan'), {:body => file.read, :qqfile => File.basename(file.path), :api_key => @user.get_map_key} response.code.should be == '200' response_json = JSON.parse(response.body) response_json.should_not be_nil - response_json['file_uri'].should match(/uploads\/.*\/whs_features.csv/) + response_json['file_uri'].should match(/uploads\/.*\/clubbing.csv/) response_json['success'].should be_true end it 'allow to upload using a file param' do - file = Rack::Test::UploadedFile.new(Rails.root.join('spec/support/whs_features.csv'), 'text/plain') + file = Rack::Test::UploadedFile.new(Rails.root.join('db/fake_data/clubbing.csv'), 'text/plain') - post v1_imports_uploads_url(:host => 'test.localhost.lan'), {:file => file, :api_key => @user.get_map_key} + post v1_uploads_url(:host => 'test.localhost.lan'), {:file => file, :api_key => @user.get_map_key} response.code.should be == '200' response_json = JSON.parse(response.body) response_json.should_not be_nil - response_json['file_uri'].should match(/uploads\/.*\/whs_features.csv/) + response_json['file_uri'].should match(/uploads\/.*\/clubbing.csv/) response_json['success'].should be_true end