title: Factory not registered: user
body: <p>I am following Michal Hartls Rails tutorial Chapter 7. I have installed the Factory girl gem. I keep getting this error when I run  my test</p>
  
  <pre><code>Failures:
  
   1) UsersController GET 'show' should be successful
       Failure/Error: @user = FactoryGirl.create(:user)
       ArgumentError:
         Factory not registered: user
       # ./spec/controllers/users_controller_spec.rb:10:in `block (3 levels) in &lt;top (required)&gt;'
  
  Finished in 0.66336 seconds 42 examples, 1 failure
  
  Failed examples:
  
  rspec ./spec/controllers/users_controller_spec.rb:14 # UsersController GET 'show' should be successful
  </code></pre>
  
  <p>Gemfile</p>
  
  <pre><code>group :test do
    gem 'autotest', '4.4.6'
    gem "autotest-growl", "~&gt; 0.2.16"
    gem "autotest-rails", "~&gt; 4.1.2"
    gem "rspec", "~&gt; 2.9.0"
    gem 'rspec-rails',  '2.9.0'
    gem 'webrat', '0.7.3'
    gem "spork",  '0.9.0'
    gem 'annotate', '~&gt; 2.4.1.beta'
    gem "factory_girl", "~&gt; 3.2.0"
  end
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', :platform =&gt;
  </code></pre>
  
  <p>My user_controller_spec.rb is</p>
  
  <pre><code>require 'spec_helper'
  
  describe UsersController do
  
    render_views
  
    describe "GET 'show'" do
      before(:each) do
      @user = FactoryGirl.create(:user)
      end
  
      it "should be successful" do
        get :show, :id =&gt; @user
        response.should be_success
      end
    end
  
    describe "GET 'new'" do
      it "should be successful" do
        get :new
        response.should be_success
      end
  
      it "should have the right title" do
        get :new
        response.should have_selector('title', :content =&gt; "Sign up")
      end
    end
  end
  </code></pre>
  
  <p>My factories.rb is</p>
  
  <pre><code>FactoryGirl.create :user do |user|
    user.name                   "Mark Brown"
    user.email                 "mbrown@yahoo.com"
    user.password               "foobar"
    user.password_confirmation  "foobar"
  end
  </code></pre>
  
  <p>I changed</p>
  
  <pre><code>Factory(:name)
  </code></pre>
  
  <p>to</p>
  
  <pre><code>FactoryGirl.create(:user)
  </code></pre>
  
  <p>on line 10 in my <code>user_controller_spec.rb</code> becuase I was getting a deprication warning. I thought that would fix it but now im just getting.</p>
  
  <pre><code>Factory not registered: user
  </code></pre>
  
  <p>Can someone tell me what going on?</p>