Commits

Josh Hubbard committed ce03c0e

Updated factory girl and rspec.

Comments (0)

Files changed (4)

 # Development Mode Gems
 group :development do
   gem 'sqlite3', '1.3.3'
-  gem 'rspec-rails', '2.6.1'
+  gem 'rspec-rails', '2.10.0'
   gem 'annotate', '2.4.0'
   gem 'ruby-debug19', :require => 'ruby-debug'
 end
 
 # Test Mode Gems
 group :test do
-   gem 'rspec', '2.6.0'
+   gem 'rspec', '2.10.0'
    gem 'webrat', '0.7.1'
-   gem 'factory_girl_rails', '1.0'
+   gem 'factory_girl_rails', '1.4.0'
    gem 'ladle'
    gem 'spork', '0.9.0'
    gem 'guard-spork', '0.3.2'
     arel (2.0.10)
     builder (2.1.2)
     coderay (1.0.9)
-    columnize (0.3.4)
+    columnize (0.3.6)
     diff-lcs (1.1.3)
     erubis (2.6.6)
       abstract (>= 1.0.0)
-    factory_girl (1.3.3)
-    factory_girl_rails (1.0)
-      factory_girl (~> 1.3)
-      rails (>= 3.0.0.beta4)
+    factory_girl (2.3.2)
+      activesupport
+    factory_girl_rails (1.4.0)
+      factory_girl (~> 2.3.0)
+      railties (>= 3.0.0)
     faraday (0.6.1)
       addressable (~> 2.2.4)
       multipart-post (~> 1.1.0)
       rack (>= 1.1.0, < 2)
+      rack (>= 1.1.0, < 2)
     formatador (0.2.4)
     gravatar_image_tag (1.0.0.pre2)
     guard (1.7.0)
       spork (>= 0.8.4)
     htmlentities (4.3.1)
     i18n (0.5.0)
-    json (1.7.6)
+    json (1.7.7)
     ladle (0.2.0)
       open4 (~> 1.0.0)
     linecache19 (0.5.12)
       mime-types (~> 1.16)
       treetop (~> 1.4.8)
     method_source (0.8.1)
-    mime-types (1.19)
-    multi_json (1.0.3)
+    mime-types (1.22)
+    multi_json (1.0.4)
     multi_xml (0.2.2)
-    multipart-post (1.1.3)
-    mysql2 (0.2.13)
+    multipart-post (1.1.5)
+    mysql2 (0.2.18)
     net-ldap (0.2.2)
     nokogiri (1.4.7)
     oa-basic (0.2.6)
       oa-core (= 0.2.6)
       rack-openid (~> 1.3.1)
       ruby-openid-apps-discovery (~> 1.2.0)
-    oauth (0.4.5)
+    oauth (0.4.7)
     oauth2 (0.4.1)
       faraday (~> 0.6.1)
       multi_json (>= 0.0.5)
       method_source (~> 0.8)
       slop (~> 3.4)
     pyu-ruby-sasl (0.0.3.3)
-    rack (1.2.7)
+    rack (1.2.8)
     rack-mount (0.6.14)
       rack (>= 1.0.0)
     rack-openid (1.3.1)
       rake (>= 0.8.7)
       rdoc (~> 3.4)
       thor (~> 0.14.4)
-    rake (10.0.3)
-    rdoc (3.12)
+    rake (10.0.4)
+    rdoc (3.12.2)
       json (~> 1.4)
-    recaptcha (0.3.1)
+    recaptcha (0.3.5)
     rest-client (1.6.7)
       mime-types (>= 1.16)
-    rspec (2.6.0)
-      rspec-core (~> 2.6.0)
-      rspec-expectations (~> 2.6.0)
-      rspec-mocks (~> 2.6.0)
-    rspec-core (2.6.4)
-    rspec-expectations (2.6.0)
-      diff-lcs (~> 1.1.2)
-    rspec-mocks (2.6.0)
-    rspec-rails (2.6.1)
-      actionpack (~> 3.0)
-      activesupport (~> 3.0)
-      railties (~> 3.0)
-      rspec (~> 2.6.0)
+    rspec (2.10.0)
+      rspec-core (~> 2.10.0)
+      rspec-expectations (~> 2.10.0)
+      rspec-mocks (~> 2.10.0)
+    rspec-core (2.10.1)
+    rspec-expectations (2.10.0)
+      diff-lcs (~> 1.1.3)
+    rspec-mocks (2.10.1)
+    rspec-rails (2.10.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      railties (>= 3.0)
+      rspec (~> 2.10.0)
     ruby-debug-base19 (0.11.25)
       columnize (>= 0.3.1)
       linecache19 (>= 0.5.11)
       columnize (>= 0.3.1)
       linecache19 (>= 0.5.11)
       ruby-debug-base19 (>= 0.11.19)
-    ruby-openid (2.1.8)
+    ruby-openid (2.2.3)
     ruby-openid-apps-discovery (1.2.0)
       ruby-openid (>= 2.1.7)
     ruby_core_source (0.1.5)
     treetop (1.4.12)
       polyglot
       polyglot (>= 0.3.1)
-    tzinfo (0.3.35)
-    uuidtools (2.1.2)
+    tzinfo (0.3.37)
+    uuidtools (2.1.3)
     webrat (0.7.1)
       nokogiri (>= 1.2.0)
       rack (>= 1.0)
       rack-test (>= 0.5.3)
-    wicked_pdf (0.7.2)
+    wicked_pdf (0.9.4)
+      rails
     will_paginate (3.0.pre2)
-    wkhtmltopdf-binary (0.9.5.3)
+    wkhtmltopdf-binary (0.9.9.1)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
   annotate (= 2.4.0)
-  factory_girl_rails (= 1.0)
+  factory_girl_rails (= 1.4.0)
   gravatar_image_tag (= 1.0.0.pre2)
   guard-spork (= 0.3.2)
   htmlentities
   omniauth (~> 0.2.6)
   rails (= 3.0.20)
   recaptcha
-  rspec (= 2.6.0)
-  rspec-rails (= 2.6.1)
+  rspec (= 2.10.0)
+  rspec-rails (= 2.10.0)
   ruby-debug19
   spork (= 0.9.0)
   sqlite3 (= 1.3.3)

spec/factories.rb

 # By using the symbol 'user' we get Factor irl to simular the User Model
 # and the plans models
 
-Factory.define :user do |user|
-  user.first_name "Test"
-  user.last_name "User"
-  user.nonPartnerInstition "CDL"
+FactoryGirl.define do
+
+  factory :user do
+    first_name "Test"
+    last_name "User"
+    nonPartnerInstition "CDL"
+  end
+
+
+  sequence :email do
+    "person#{n}@example.com"
+  end
+
+  factory :plan do
+    name "Test User NSF Plan"
+    solicitation_no "123"
+    desc "this is a test plan for user test user"
+    association :user
+  end
+
 end
-
-Factory.sequence :email do |n|
-  "person#{n}@example.com"
-end
-
-Factory.define :plan do |plan|
-  plan.name "Test User NSF Plan"
-  plan.solicitation_no "123"
-  plan.desc "this is a test plan for user test user"
-  plan.association :user
-end

spec/spec_helper.rb

   require 'rspec/autorun'
 
   Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
+
+  RSpec.configure do |config|
+    config.infer_base_class_for_anonymous_controllers = false
+  end
 end
 
 Spork.each_run do
 # free to delete them.
 
 
-
-
 # This file is copied to spec/ when you run 'rails generate rspec:install'
 ENV["RAILS_ENV"] ||= 'test'
 require File.expand_path("../../config/environment", __FILE__)
 
 # 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}
+Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
 
 RSpec.configure do |config|
   # == Mock Framework