Skip to content

Instantly share code, notes, and snippets.

@tadejm
Forked from anonymous/-
Last active December 28, 2015 09:59
Show Gist options
  • Save tadejm/7482568 to your computer and use it in GitHub Desktop.
Save tadejm/7482568 to your computer and use it in GitHub Desktop.
diff --git a/Guardfile b/Guardfile
index 8382d1c..5009879 100644
--- a/Guardfile
+++ b/Guardfile
@@ -9,16 +9,10 @@ guard 'spork', :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb') { :rspec }
- watch(%r{features/support/}) { :cucumber }
- watch(%r{^app/models/.+\.rb$})
- watch(%r{^app/controllers/.+\.rb$})
- watch(%r{^app/mailers/.+\.rb$})
- watch(%r{^app/helpers/.+\.rb$})
- watch(%r{^app/behaviors/.+\.rb$})
end
-guard 'rspec', :version => 1,:all_on_start => false, :all_after_pass => false, :cli => "--drb --color --loadby mtime --reverse" do
+guard 'rspec', :version => 1,:all_on_start => false, :all_after_pass => false, :cli => "--drb --color --loadby mtime --reverse RUBYOPT=W0" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
@@ -32,31 +26,7 @@ guard 'rspec', :version => 1,:all_on_start => false, :all_after_pass => false, :
watch('spec/spec_helper.rb') { "spec" }
watch('config/routes.rb') { "spec/routing" }
watch('app/controllers/application_controller.rb') { "spec/controllers" }
- # Capybara request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
end
-guard 'cucumber', :all_on_start => false, :all_after_pass => false, :cli => 'PATH=/opt/firefox-for-selenium:$PATH -p guard' 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
-
-guard 'rspec', :version => 2, :all_after_pass => false, :all_on_start => false, :run_all => { :cli => "rake parallel:spec[4]" }, :focus_on_failed => false do
- watch(%r{^spec/.+_spec\.rb$})
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
- watch('spec/spec_helper.rb') { "spec" }
-
- # Rails example
- watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
- watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
- watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
- watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
- watch('config/routes.rb') { "spec/routing" }
- watch('app/controllers/application_controller.rb') { "spec/controllers" }
- # Capybara request specs
- watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
-end
-
-notification :off
\ No newline at end of file
+notification :off
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 247a9e9..238bf96 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -6,7 +6,7 @@
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
+config.cache_classes = false
TEST_CACHE_NAMESPACE = "test:#{ENV['TEST_ENV_NUMBER']}:#{Digest::MD5.hexdigest(Rails.root)[0..7]}"
config.action_controller.cache_store = :mem_cache_store, { :namespace => TEST_CACHE_NAMESPACE }
diff --git a/spec/lib/assistance_offer_mailer_spec.rb b/spec/lib/assistance_offer_mailer_spec.rb
index d312401..4ecaf1b 100644
--- a/spec/lib/assistance_offer_mailer_spec.rb
+++ b/spec/lib/assistance_offer_mailer_spec.rb
@@ -12,7 +12,7 @@ describe AssistanceOfferMailer do
}
it "does not create an assistance offer if the booking event is different than EnterBillingDetails" do
- BookingEvent::ReviewDetails.create_for(booking, :message => "Generic Message")
+ # BookingEvent::ReviewDetails.create_for(booking, :message => "Generic Message")
expect {
HT::Errands::HousetripBookingSendAssistanceEmails.new.run
}.to_not change(BookingEvent, :count)
diff --git a/spec/mailers/helpers/cached_elements_helper_spec.rb b/spec/mailers/helpers/cached_elements_helper_spec.rb
index 47acaf0..6490db7 100644
--- a/spec/mailers/helpers/cached_elements_helper_spec.rb
+++ b/spec/mailers/helpers/cached_elements_helper_spec.rb
@@ -16,7 +16,7 @@ describe MailersHelper::CachedElements do
before { Rails.cache.clear }
describe "#url_for_destination_landing_page" do
- let(:get_url) { dummy_object.url_for_destination_landing_page(destination, {:param1 => "value"}) }
+# let(:get_url) { dummy_object.url_for_destination_landing_page(destination, {:param1 => "value"}) }
before do
dummy_object.stub(:destination_landing_page_url => "http://www.mywebsite.com/destination1")
@@ -60,4 +60,4 @@ describe MailersHelper::CachedElements do
cached_url.should == "http://www.mywebsite.com/destination1/image"
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 61b8b01..c5b28ae 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -134,6 +134,10 @@ Spork.prefork do
end
Spork.each_run do
+ Dir.glob(Rails.root.join('app/behaviors/**/*.rb')).each { |file| load file }
+ Dir.glob(Rails.root.join('lib/sqs/**/*.rb')).each { |file| load file }
+ Dir.glob(Rails.root.join('lib/mailers/**/*.rb')).each { |file| load file }
+ Dir.glob(Rails.root.join('lib/new_sqs/**/*.rb')).each { |file| load file }
I18n.locale = 'en'
Money.currency_code = 'EUR'
Timecop.return
diff --git a/spec/support/data_tiering_auto_sync_for_property_search.rb b/spec/support/data_tiering_auto_sync_for_property_search.rb
index b1b6d75..a9be09e 100644
--- a/spec/support/data_tiering_auto_sync_for_property_search.rb
+++ b/spec/support/data_tiering_auto_sync_for_property_search.rb
@@ -20,7 +20,7 @@ module DataTiering::AutoSyncInTests
end
-
+PropertySearch
class PropertySearch
include DataTiering::AutoSyncInTests
* Unmerged path spec/support/shared_examples/minimum_standards_controller.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment