Fabrication integration #30
Conversation
21094f1
to
69aedb1
69aedb1
to
4ec15ee
Looks great! Thank you for your work! Definitely worth to get merged) So feel free to update all the docs. |
FactoryGirl.build_stubbed(:user) | ||
User.first | ||
expect(result.stacks.size).to eq 0 | ||
matcher :have_no_stacks do |
palkan
Oct 1, 2017
Collaborator
I'd prefer no to dry out specs this way; that makes specs less readable (especially when matchers have hard-coded expectations). Sometimes duplication is not evil.
I'd prefer no to dry out specs this way; that makes specs less readable (especially when matchers have hard-coded expectations). Sometimes duplication is not evil.
@@ -1,13 +1,19 @@ | |||
# frozen_string_literal: true | |||
|
|||
require "test_prof/factory_prof/factory_girl_patch" |
palkan
Oct 1, 2017
Collaborator
Let's move patches requires to the corresponding factory_builders, since we apply them there.
Let's move patches requires to the corresponding factory_builders, since we apply them there.
@@ -5,7 +5,7 @@ module FactoryProf | |||
# Wrap #run method with FactoryProf tracking | |||
module FactoryGirlPatch | |||
def run(strategy = @strategy) | |||
FactoryProf.track(strategy, @name) { super } | |||
TestProf::FactoryProf::FactoryBuilders::FactoryGirl.track(strategy, @name) { super } |
palkan
Oct 1, 2017
Collaborator
Can't we just use FactoryBuilders::FactoryGirl
without TestProf::FactoryProf::...
?
Can't we just use FactoryBuilders::FactoryGirl
without TestProf::FactoryProf::...
?
4ec15ee
to
635a9d3
@palkan Thanks for the review! I updated the PR according to your comments. Also readme and changelog entries added. |
Thank you! I need your full name (in Russian) for CultOfMartians (if you don't mind) |
@palkan full name in Russian is |
@shkrt http://cultofmartians.com/tasks/test-prof-fabrication.html btw, how can I found on Twitter? I'd like to make an announcement |
@palkan Sorry, I have no Twitter account |
You are lucky man) ok, no problem) |
Hey @shkrt! Could you please send me your actual email address to |
Purpose of this pull request:
Add Fabrication gem support for FactoryProf #22
What changes did you make? (overview):
extracted FactoryGirl patching method to separate class, alongside with newly created Fabrication patch;
unified FactoryProf#track method so it does not rely on arguments passed from FactoryGirl;
changed integration specs so they mimick factories created both by FactoryGirl and Fabrication;
changed FactoryProf's unit specs and refactored similar expectations logic;
added Fabrication fixtures;
Is there anything you'd like reviewers to focus on?
I assumed that one app may have bundled with both FactoryGirl and Fabrication. Respective integration spec reflects this case.
I did not include neither readme updates, nor changelog entries yet. I can get them ready if the reviewers would find this PR worthy to merge.