DEV: Fix failing tests.



DEV: Fix failing tests.

diff --git a/spec/models/user_profile_spec.rb b/spec/models/user_profile_spec.rb
index f4b64bc..c52427b 100644
--- a/spec/models/user_profile_spec.rb
+++ b/spec/models/user_profile_spec.rb
@@ -38,7 +38,7 @@ describe UserProfile do
   describe 'new' do
-    let(:user_profile) { }
+    let(:user_profile) { "test") }
     it 'is not valid without user' do
       expect(user_profile.valid?).to be false

GitHub sha: 62579d79

Approved #2


Grrr… I am not sure how much this fabrication library is really saving us long term.

Why even have a fabricator for user profile if we don’t want to use it?


Fabricator is actually very useful and I sincerely hope we don’t use fixtures or even have to build records by hand. The test broke because I made changes to the default fabricator. I think I could have done, user: nil) but it was much easier with the change I made,


Note I don’t object to having helper that build up records for us, I have thought of “fast and safe fixture” pattern where you “record” the first time you create the record and on subsequent test runs can just replay the ultra fast recording.

My main gripe with the fabricator library is that a lot of magic is assumed when records are complicated and have a lot of dependencies so I kind of prefer an explicit implementation.


I am also a big fan of fabricator overall. You will always find cases where fixtures are better and vice versa, but overall it works really well. I don’t think we should be making any hasty changes here.