aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/admin_public_body_controller_spec.rb9
-rw-r--r--spec/models/user_spec.rb15
-rw-r--r--spec/spec.opts6
-rw-r--r--spec/spec_helper.rb23
4 files changed, 53 insertions, 0 deletions
diff --git a/spec/controllers/admin_public_body_controller_spec.rb b/spec/controllers/admin_public_body_controller_spec.rb
new file mode 100644
index 000000000..87f7e1185
--- /dev/null
+++ b/spec/controllers/admin_public_body_controller_spec.rb
@@ -0,0 +1,9 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe AdminPublicBodyController, "#route_for" do
+
+ it "should map { :controller => 'admin_public_body', :action => 'list' } to /admin/body/list" do
+ route_for(:controller => "admin_public_body", :action => "list").should == "/admin/body/list"
+ end
+
+end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
new file mode 100644
index 000000000..879006b4b
--- /dev/null
+++ b/spec/models/user_spec.rb
@@ -0,0 +1,15 @@
+require File.dirname(__FILE__) + '/../spec_helper'
+
+describe User, " when authenticating" do
+
+ before do
+ @user = User.new
+ end
+
+ it "should create a hashed password when the password is set" do
+ @user.hashed_password.should be_nil
+ @user.password = "a test password"
+ @user.hashed_password.should_not be_nil
+ end
+
+end \ No newline at end of file
diff --git a/spec/spec.opts b/spec/spec.opts
new file mode 100644
index 000000000..d8c8db5d4
--- /dev/null
+++ b/spec/spec.opts
@@ -0,0 +1,6 @@
+--colour
+--format
+progress
+--loadby
+mtime
+--reverse
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 000000000..e5d4f2259
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,23 @@
+# This file is copied to ~/spec when you run 'ruby script/generate rspec'
+# from the project root directory.
+ENV["RAILS_ENV"] = "test"
+require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require 'spec/rails'
+
+Spec::Runner.configure do |config|
+ config.use_transactional_fixtures = true
+ config.use_instantiated_fixtures = false
+ config.fixture_path = RAILS_ROOT + '/spec/fixtures'
+
+ # You can declare fixtures for each behaviour like this:
+ # describe "...." do
+ # fixtures :table_a, :table_b
+ #
+ # Alternatively, if you prefer to declare them only once, you can
+ # do so here, like so ...
+ #
+ # config.global_fixtures = :table_a, :table_b
+ #
+ # If you declare global fixtures, be aware that they will be declared
+ # for all of your examples, even those that don't use them.
+end