Fix Redis startup on testing

pull/240/head
Alejandro 11 years ago
parent b93f6bf014
commit 21af04c905

@ -97,4 +97,5 @@ group :development, :test do
#gem "minitest-ci", "~> 3.0.1", :require => false
# Server
gem 'thin', require: false
gem 'parallel_tests'
end

@ -190,6 +190,9 @@ GEM
rack (~> 1.2)
oily_png (1.0.3)
chunky_png (~> 1.2.1)
parallel (0.7.1)
parallel_tests (0.15.0)
parallel
pg (0.11.0)
poltergeist (1.0.2)
capybara (~> 1.1)
@ -359,6 +362,7 @@ DEPENDENCIES
oauth (= 0.4.5)
oauth-plugin (= 0.4.0.pre4)
oily_png (~> 1.0.2)
parallel_tests
pg (= 0.11)
poltergeist (>= 1.0.0)
rack (= 1.4.1)

@ -1,99 +0,0 @@
# encoding: utf-8
require_relative '../acceptance_helper'
feature 'Table' do
background do
CartoDB::Varnish.any_instance.stubs(:send_command).returns(true)
@user = FactoryGirl.create(:user)
@table = FactoryGirl.create(:table, :user_id => @user.id, :tags => 'tag 1, wadus')
end
scenario 'allow users to create a new column' do
log_in_as(@user)
click_on @table.name
find('.add_column').click
page.should have_content 'Add new column'
find('input.column_name').set 'wadus'
expect do
click_on 'Create column'
end.to change{ @table.schema.length }.from(6).to(7)
within 'div.table table thead tr th:eq(6)' do
page.should have_css 'div div label.strong', :text => 'wadus'
page.should have_css 'div div p.small', :text => 'string'
end
end
scenario 'allow users to delete a existing column' do
log_in_as(@user)
click_on @table.name
click_on 'name'
expect do
click_on 'Delete this column'
end.to change{ @table.schema.length }.from(6).to(5)
page.should have_content 'Your column has been deleted'
page.should_not have_css 'div.table table thead tr th div div label.strong', :text => 'name'
end
scenario 'allow users to change the type of a column' do
log_in_as(@user)
click_on @table.name
within 'div.table table thead tr th:eq(5)' do
click_on 'name'
click_on 'Change data type...'
click_on 'number'
end
click_on 'Yes, do it'
page.should have_content 'Column type has been changed'
@table.schema.should include([:name, "number"])
@table.schema.should_not include([:name, "string"])
within 'div.table table thead tr th:eq(5)' do
click_on 'number'
end
click_on 'number'
click_on 'Yes, do it'
page.should have_content 'Column type has been changed'
@table.schema.should_not include([:name, "number"])
@table.schema.should include([:name, "string"])
end
scenario 'allow users to change the type of a column to a destructive type (from string to number)'
scenario 'allow users to change the name of a column'
scenario 'allow users to create a new row and fill some columns'
scenario 'allow users to delete a row'
scenario 'allow users to edit a cell'
scenario 'allow users to perform a query and paginate the results several times (up and down)'
scenario 'allow users to create table from a query'
scenario 'allow users to duplicate a table'
scenario 'allow users to mark a table as public / private'
scenario 'allow users to open your public URL in a different window'
scenario 'allow users to tag a table'
scenario 'allow users to add a description to a table'
scenario 'allow users to rename a table'
scenario 'allow users to paginate its rows several times (up & down)'
end

@ -24,11 +24,14 @@ module CartoDB
if File.file?(pid_path)
File.delete(pid_path)
end
command = "`which redis-server` #{Rails.root}/spec/support/redis/redis.conf"
command = "`which redis-server` #{Rails.root}/spec/support/redis/redis.conf" +
( Cartodb.config[:redis].fetch('port', false) ?
" --port #{Cartodb.config[:redis]['port']}" : ""
)
system(command)
sleep 2
puts "[redis] Running test server..."
end
end
end
end

Loading…
Cancel
Save