aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-09 13:29:41 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-10 11:18:10 +0200
commitf940252f3d92877d6d3b6808c14bea9f1a564cc7 (patch)
tree95ab0d08045c6cc2350a5a2e2a03adca61f2c8a8 /site/spec/spec_helper.rb
parentA plain hobo application (diff)
downloadcouncil-webapp-f940252f3d92877d6d3b6808c14bea9f1a564cc7.tar.gz
council-webapp-f940252f3d92877d6d3b6808c14bea9f1a564cc7.tar.bz2
council-webapp-f940252f3d92877d6d3b6808c14bea9f1a564cc7.zip
A working rspec test
Diffstat (limited to 'site/spec/spec_helper.rb')
-rw-r--r--site/spec/spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/site/spec/spec_helper.rb b/site/spec/spec_helper.rb
new file mode 100644
index 0000000..20a45b7
--- /dev/null
+++ b/site/spec/spec_helper.rb
@@ -0,0 +1,15 @@
+ENV["RAILS_ENV"] ||= 'test'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+
+RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
+environment_path = File.expand_path(File.join(RAILS_ROOT, 'config', 'environment'))
+require(environment_path)
+
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+RSpec.configure do |config|
+ config.mock_with :rspec
+end