Skip to content

Instantly share code, notes, and snippets.

@urbantumbleweed
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save urbantumbleweed/10000810 to your computer and use it in GitHub Desktop.
Save urbantumbleweed/10000810 to your computer and use it in GitHub Desktop.
Setting up testing environment
require 'spec_helper'
describe Person do
before do
let(:person) { factory(:person) }
end
describe ".create" do
it "should have an img_url, drinks_attribute, license, first name and last name when created" do
expect(person.name).to eq("Mike Smith")
end
end
end
require 'spec_helper'
FactoryGirl.define do
factory :person, class: Person do
first_name "Mike"
last_name "Smith"
img_url "http://placesheen.com/200/300"
birthdate "1980-1-12"
drinks 0
licence false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment