Last active
August 29, 2015 13:58
-
-
Save urbantumbleweed/10000810 to your computer and use it in GitHub Desktop.
Setting up testing environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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