Skip to content
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

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

MaicolBen
Copy link
Contributor

I'm not sure to include all the rspec config commented as an example

describe FactoryGirl do
FactoryGirl.factories.map(&:name).each do |factory_name|
describe "The #{factory_name} factory" do
it 'is valid' do
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link

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
Copy link

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
Copy link

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec is not necessary

Copy link
Contributor Author

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

@MaicolBen MaicolBen force-pushed the add-rspec branch 3 times, most recently from 3178038 to ee5ea59 Compare October 18, 2016 20:36
@MaicolBen MaicolBen merged commit 19e3422 into master Oct 19, 2016
@MaicolBen MaicolBen deleted the add-rspec branch October 19, 2016 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants