-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added rspec, factory girl, faker and database cleanner #8
Conversation
d1a2927
to
55a67b0
Compare
describe FactoryGirl do | ||
FactoryGirl.factories.map(&:name).each do |factory_name| | ||
describe "The #{factory_name} factory" do | ||
it 'is valid' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you prefer to have a custom message instead of it { expect(FactoryGirl.build(factory_name)).to be_valid }
. Do you want to be consistent with the messages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't realize about that, I'll change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it this way. I prefer to set the messages myself.
describe FactoryGirl do | ||
FactoryGirl.factories.map(&:name).each do |factory_name| | ||
describe "The #{factory_name} factory" do | ||
it 'is valid' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it this way. I prefer to set the messages myself.
@@ -0,0 +1,7 @@ | |||
FactoryGirl.define do | |||
factory :user, class: 'User' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class: 'User' is not necessary
|
||
require 'spec_helper' | ||
|
||
RSpec.describe User do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec is not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work in circle CI, I'll check again
3178038
to
ee5ea59
Compare
I'm not sure to include all the rspec config commented as an example