From 86bec2845701015ce46359f4a48340862af9c436 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Fri, 1 May 2015 17:19:39 +0000 Subject: [PATCH] Improve route changes handling under guard/spork --- Guardfile | 2 +- spec/spec_helper.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Guardfile b/Guardfile index f72f00d..242731e 100644 --- a/Guardfile +++ b/Guardfile @@ -3,7 +3,6 @@ directories %w[app config spec] guard :spork, rspec_env: { RAILS_ENV: 'test' } do watch('config/application.rb') watch('config/environment.rb') - watch('config/routes.rb') watch(%r{^config/environments/.+\.rb$}) watch(%r{^config/initializers/.+\.rb$}) watch('spec/spec_helper.rb') @@ -13,6 +12,7 @@ end guard :rspec, cmd: 'bundle exec rspec --drb -f doc' do watch(%r{^spec/.+_spec\.rb$}) + watch('config/routes.rb') { 'spec' } watch('spec/spec_helper.rb') { 'spec' } watch(%r{^spec/support/.+\.rb$}) { 'spec' } watch('spec/factories.rb') { 'spec' } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7e112bb..d654ba1 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,5 +18,6 @@ Spork.prefork do end Spork.each_run do + Rails.application.reload_routes! FactoryGirl.reload end