title: Factory Girl: NameError: uninitialized constant Vserver
body: <p>I am trying to setup the unit testing with Factory Girl and Rspec for my Sinatra application. </p>
  
  <p>Gem file: </p>
  
  <pre><code>group :test do
    gem "rack-test"
    gem "fuubar"
    gem "factory_girl"
    gem "yard"
  end
  </code></pre>
  
  <h1>spec/factories/vserver.rb</h1>
  
  <pre><code>require 'factory_girl'
  
  FactoryGirl.define do
    factory :vserver do
      first_name "John"
      last_name  "Doe"
    end
  end
  </code></pre>
  
  <h1>spec/spec_helper.rb</h1>
  
  <pre><code>require File.join(File.dirname(__FILE__), "..", "app.rb")
  
  %w{
    rubygems
    sinatra
    dm-core
    rack/test
    uuid
    factory_girl
    rspec
    pp
  
    spec/factories/vserver
  }.each { |r| require r }
  
  set :environment, :test
  
  # RSpec without Rails
  RSpec.configure do |config|
    config.include FactoryGirl::Syntax::Methods
  end
  </code></pre>
  
  <h1>spec/app_spec.rb</h1>
  
  <pre><code>require './spec_helper.rb'
  require 'factory_girl'
  
  describe "Cdot" do
  
  include Rack::Test::Methods
  
  def app
    StorageApi
  end
  
  it 'vserver' do
  
    FactoryGirl.build(:vserver)
  
  end
  
  end
  </code></pre>
  
  <p>Issue: When I run the rspec file using the command: rspec app_spec.rb, I get the below error.</p>
  
  <p>NameError: uninitialized constant Vserver</p>
  
  <p>Help is much appreciated.</p>