adding a bit to tubbo's spork branch
This commit is contained in:
parent
98b41d8f1d
commit
adf85e1ec6
6 changed files with 204 additions and 148 deletions
1
.rspec
1
.rspec
|
|
@ -3,3 +3,4 @@
|
||||||
--color
|
--color
|
||||||
--tag ~performance
|
--tag ~performance
|
||||||
--order random
|
--order random
|
||||||
|
--drb
|
||||||
5
Gemfile
5
Gemfile
|
|
@ -149,6 +149,11 @@ group :test do
|
||||||
gem 'webmock', :require => false
|
gem 'webmock', :require => false
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
gem 'mock_redis'
|
gem 'mock_redis'
|
||||||
|
|
||||||
|
gem 'spork', '~> 1.0rc'
|
||||||
|
gem 'guard-rspec'
|
||||||
|
gem 'guard-spork'
|
||||||
|
gem 'guard-cucumber'
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
|
|
|
||||||
16
Gemfile.lock
16
Gemfile.lock
|
|
@ -193,6 +193,17 @@ GEM
|
||||||
gem_plugin (0.2.3)
|
gem_plugin (0.2.3)
|
||||||
gherkin (2.9.3)
|
gherkin (2.9.3)
|
||||||
json (>= 1.4.6)
|
json (>= 1.4.6)
|
||||||
|
guard (1.0.1)
|
||||||
|
ffi (>= 0.5.0)
|
||||||
|
thor (~> 0.14.6)
|
||||||
|
guard-cucumber (0.7.5)
|
||||||
|
cucumber (>= 0.10)
|
||||||
|
guard (>= 0.8.3)
|
||||||
|
guard-rspec (0.7.0)
|
||||||
|
guard (>= 0.10.0)
|
||||||
|
guard-spork (0.5.2)
|
||||||
|
guard (>= 0.10.0)
|
||||||
|
spork (>= 0.8.4)
|
||||||
haml (3.1.4)
|
haml (3.1.4)
|
||||||
handlebars_assets (0.4.1)
|
handlebars_assets (0.4.1)
|
||||||
execjs (>= 1.2.9)
|
execjs (>= 1.2.9)
|
||||||
|
|
@ -405,6 +416,7 @@ GEM
|
||||||
rack (~> 1.3, >= 1.3.6)
|
rack (~> 1.3, >= 1.3.6)
|
||||||
rack-protection (~> 1.2)
|
rack-protection (~> 1.2)
|
||||||
tilt (~> 1.3, >= 1.3.3)
|
tilt (~> 1.3, >= 1.3.3)
|
||||||
|
spork (1.0.0rc2)
|
||||||
sprockets (2.0.3)
|
sprockets (2.0.3)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
|
|
@ -485,6 +497,9 @@ DEPENDENCIES
|
||||||
foreigner (~> 1.1.0)
|
foreigner (~> 1.1.0)
|
||||||
foreman (= 0.34.1)
|
foreman (= 0.34.1)
|
||||||
fuubar (= 0.0.6)
|
fuubar (= 0.0.6)
|
||||||
|
guard-cucumber
|
||||||
|
guard-rspec
|
||||||
|
guard-spork
|
||||||
haml
|
haml
|
||||||
handlebars_assets
|
handlebars_assets
|
||||||
heroku
|
heroku
|
||||||
|
|
@ -538,6 +553,7 @@ DEPENDENCIES
|
||||||
sass-rails (= 3.1.4)
|
sass-rails (= 3.1.4)
|
||||||
selenium-webdriver (~> 2.16.0)
|
selenium-webdriver (~> 2.16.0)
|
||||||
settingslogic!
|
settingslogic!
|
||||||
|
spork (~> 1.0rc)
|
||||||
sqlite3
|
sqlite3
|
||||||
thin (~> 1.3.1)
|
thin (~> 1.3.1)
|
||||||
timecop
|
timecop
|
||||||
|
|
|
||||||
18
Guardfile
18
Guardfile
|
|
@ -18,3 +18,21 @@ guard 'rspec', :version => 2, :all_on_start => false do
|
||||||
# Capybara request specs
|
# Capybara request specs
|
||||||
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' }, :all_on_start => false do
|
||||||
|
watch('config/application.rb')
|
||||||
|
watch('config/environment.rb')
|
||||||
|
watch(%r{^config/environments/.+\.rb$})
|
||||||
|
watch(%r{^config/initializers/.+\.rb$})
|
||||||
|
watch('Gemfile')
|
||||||
|
watch('Gemfile.lock')
|
||||||
|
watch('spec/spec_helper.rb') { :rspec }
|
||||||
|
watch('test/test_helper.rb') { :test_unit }
|
||||||
|
watch(%r{features/support/}) { :cucumber }
|
||||||
|
end
|
||||||
|
|
||||||
|
guard 'cucumber' do
|
||||||
|
watch(%r{^features/.+\.feature$})
|
||||||
|
watch(%r{^features/support/.+$}) { 'features' }
|
||||||
|
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
require 'rubygems'
|
||||||
# It is recommended to regenerate this file in the future when you upgrade to a
|
require 'spork'
|
||||||
# newer version of cucumber-rails. Consider adding your own code to a new file
|
#uncomment the following line to use spork with the debugger
|
||||||
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
#require 'spork/ext/ruby-debug'
|
||||||
# files.
|
|
||||||
|
|
||||||
|
Spork.prefork do
|
||||||
ENV["RAILS_ENV"] ||= "test"
|
ENV["RAILS_ENV"] ||= "test"
|
||||||
require 'cucumber/rails'
|
require 'cucumber/rails'
|
||||||
|
|
||||||
|
|
@ -16,6 +16,7 @@ require 'cucumber/api_steps'
|
||||||
# Ensure we know the appservers port
|
# Ensure we know the appservers port
|
||||||
Capybara.server_port = 9887
|
Capybara.server_port = 9887
|
||||||
|
|
||||||
|
|
||||||
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
|
||||||
# order to ease the transition to Capybara we set the default here. If you'd
|
# order to ease the transition to Capybara we set the default here. If you'd
|
||||||
# prefer to use XPath just remove this line and adjust any selectors in your
|
# prefer to use XPath just remove this line and adjust any selectors in your
|
||||||
|
|
@ -56,6 +57,17 @@ include HelperMethods
|
||||||
require 'webmock/cucumber'
|
require 'webmock/cucumber'
|
||||||
WebMock.disable_net_connect!(:allow_localhost => true)
|
WebMock.disable_net_connect!(:allow_localhost => true)
|
||||||
|
|
||||||
|
silence_warnings do
|
||||||
|
SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'}
|
||||||
|
AppConfig[:configured_services] << 'facebook'
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support", "fake_resque")
|
||||||
|
|
||||||
|
require File.join(File.dirname(__FILE__), 'run_resque_in_process')
|
||||||
|
end
|
||||||
|
|
||||||
|
Spork.each_run do
|
||||||
Before do
|
Before do
|
||||||
@no_follow_diaspora_hq_setting = AppConfig[:no_follow_diasporahq]
|
@no_follow_diaspora_hq_setting = AppConfig[:no_follow_diasporahq]
|
||||||
AppConfig[:no_follow_diasporahq] = true
|
AppConfig[:no_follow_diasporahq] = true
|
||||||
|
|
@ -71,15 +83,6 @@ After do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
silence_warnings do
|
|
||||||
SERVICES['facebook'] = {'app_id' => :fake, 'app_secret' => 'sdoigjosdfijg'}
|
|
||||||
AppConfig[:configured_services] << 'facebook'
|
|
||||||
end
|
|
||||||
|
|
||||||
require File.join(File.dirname(__FILE__), "..", "..", "spec", "support", "fake_resque")
|
|
||||||
require File.join(File.dirname(__FILE__), 'run_resque_in_process')
|
|
||||||
|
|
||||||
|
|
||||||
Before('@localserver') do
|
Before('@localserver') do
|
||||||
TestServerFixture.start_if_needed
|
TestServerFixture.start_if_needed
|
||||||
CapybaraSettings.instance.save
|
CapybaraSettings.instance.save
|
||||||
|
|
@ -90,4 +93,4 @@ end
|
||||||
After('@localserver') do
|
After('@localserver') do
|
||||||
CapybaraSettings.instance.restore
|
CapybaraSettings.instance.restore
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
@ -2,6 +2,16 @@
|
||||||
# licensed under the Affero General Public License version 3 or later. See
|
# licensed under the Affero General Public License version 3 or later. See
|
||||||
# the COPYRIGHT file.
|
# the COPYRIGHT file.
|
||||||
|
|
||||||
|
require 'rubygems'
|
||||||
|
require 'spork'
|
||||||
|
#uncomment the following line to use spork with the debugger
|
||||||
|
#require 'spork/ext/ruby-debug'
|
||||||
|
|
||||||
|
Spork.prefork do
|
||||||
|
# Loading more in this block will cause your tests to run faster. However,
|
||||||
|
# if you change any configuration or code from libraries loaded here, you'll
|
||||||
|
# need to restart spork for it take effect.
|
||||||
|
|
||||||
ENV["RAILS_ENV"] ||= 'test'
|
ENV["RAILS_ENV"] ||= 'test'
|
||||||
require File.join(File.dirname(__FILE__), '..', 'config', 'environment') unless defined?(Rails)
|
require File.join(File.dirname(__FILE__), '..', 'config', 'environment') unless defined?(Rails)
|
||||||
require 'helper_methods'
|
require 'helper_methods'
|
||||||
|
|
@ -12,6 +22,45 @@ require 'factory_girl'
|
||||||
|
|
||||||
include HelperMethods
|
include HelperMethods
|
||||||
|
|
||||||
|
Dir["#{File.dirname(__FILE__)}/shared_behaviors/**/*.rb"].each do |f|
|
||||||
|
require f
|
||||||
|
end
|
||||||
|
|
||||||
|
ProcessedImage.enable_processing = false
|
||||||
|
UnprocessedImage.enable_processing = false
|
||||||
|
|
||||||
|
def set_up_friends
|
||||||
|
[local_luke, local_leia, remote_raphael]
|
||||||
|
end
|
||||||
|
|
||||||
|
def alice
|
||||||
|
@alice ||= User.where(:username => 'alice').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def bob
|
||||||
|
@bob ||= User.where(:username => 'bob').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def eve
|
||||||
|
@eve ||= User.where(:username => 'eve').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def local_luke
|
||||||
|
@local_luke ||= User.where(:username => 'luke').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def local_leia
|
||||||
|
@local_leia ||= User.where(:username => 'leia').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def remote_raphael
|
||||||
|
@remote_raphael ||= Person.where(:diaspora_handle => 'raphael@remote.net').first
|
||||||
|
end
|
||||||
|
|
||||||
|
def photo_fixture_name
|
||||||
|
@photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png')
|
||||||
|
end
|
||||||
|
|
||||||
# Force fixture rebuild
|
# Force fixture rebuild
|
||||||
FileUtils.rm_f(File.join(Rails.root, 'tmp', 'fixture_builder.yml'))
|
FileUtils.rm_f(File.join(Rails.root, 'tmp', 'fixture_builder.yml'))
|
||||||
|
|
||||||
|
|
@ -45,46 +94,10 @@ RSpec.configure do |config|
|
||||||
`rm -rf #{Rails.root}/tmp/uploads/*`
|
`rm -rf #{Rails.root}/tmp/uploads/*`
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Dir["#{File.dirname(__FILE__)}/shared_behaviors/**/*.rb"].each do |f|
|
|
||||||
require f
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Spork.each_run do
|
||||||
ProcessedImage.enable_processing = false
|
# This code will be run each time you run your specs.
|
||||||
UnprocessedImage.enable_processing = false
|
|
||||||
|
|
||||||
AppConfig.load!
|
AppConfig.load!
|
||||||
AppConfig.setup!
|
AppConfig.setup!
|
||||||
|
|
||||||
def set_up_friends
|
|
||||||
[local_luke, local_leia, remote_raphael]
|
|
||||||
end
|
|
||||||
|
|
||||||
def alice
|
|
||||||
@alice ||= User.where(:username => 'alice').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def bob
|
|
||||||
@bob ||= User.where(:username => 'bob').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def eve
|
|
||||||
@eve ||= User.where(:username => 'eve').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def local_luke
|
|
||||||
@local_luke ||= User.where(:username => 'luke').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def local_leia
|
|
||||||
@local_leia ||= User.where(:username => 'leia').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def remote_raphael
|
|
||||||
@remote_raphael ||= Person.where(:diaspora_handle => 'raphael@remote.net').first
|
|
||||||
end
|
|
||||||
|
|
||||||
def photo_fixture_name
|
|
||||||
@photo_fixture_name = File.join(File.dirname(__FILE__), 'fixtures', 'button.png')
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue