I have a factory such as:
FactoryGirl.define do
factory :page do
title 'Fake Title For Page'
end
end
And a test:
describe "LandingPages" do
it "should load the landing page with the correct data" do
page = FactoryGirl.create(:page)
visit page_path(page)
end
end
My spec_helper.rb contains:
require 'factory_girl_rails'
and yet I keep getting:
LandingPages should load the landing page with the correct data
Failure/Error: page = FactoryGirl.create(:page)
NameError:
uninitialized constant Page
# ./spec/features/landing_pages_spec.rb:5:in `block (2 levels) in <top (required)>'
This is a new project, so I don't believe the test is actually the problem. I believe it could be setup incorrectly. Any ideas on things to try and/or where to look to resolve this?
My uneventful pages.rb file:
class Pages < ActiveRecord::Base
# attr_accessible :title, :body
end
factory :page, class: OpenStruct
– Cyanine