How to set up factory in FactoryBot with has_many association

Alternatively, you can use a block and skip the association keyword. This makes it possible to build objects without saving to the database (otherwise, a has_many association will save your records to the db, even if you use the build function instead of create). FactoryGirl.define do factory :listing_with_features, :parent => :listing do |listing| features { … Read more

How to find which rspec test is taking so long

In RSpec 2 and 3, you can use the –profile flag or add –profile to your .rspec file. This will track the top 10 slowest examples. For RSpec 1, you can use –format o with spec command. It shows a text-based progress bar with profiling of 10 slowest examples. For more details see this. rspec … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)