great video !!!! in the next video for complex tests can you show examples how i can refactor long tests , and , if is possible create a function or method when i have to build factories with same format, example form4=build.... and these lines are repeated along my tests? . would be nice if teach us some about code coverage with simplecov... thanks in advance,,, channels like yours keep Rails alive.
When you create the model and a migration, and run the migrations, the schema is automatically updated. This is a solid question and something I totally glossed over. Will try to cover this better in the future.
@@cjav_dev Im familiar with the schema being created, but Ive never come across the table details in the model like you have here. I even ran a rails g rspec:mode dummy name born_at:integer to see if it was something I may have missed but nothing was there
oh! so if you run `rails g rspec:model Dummy` that'll create the spec file and the factory, but both will be empty, even if the schema has columns. If you run `rails g rspec:model Dummy born_at:integer` that should create the same spec file, but the factory should have a new born_at thing setup for you. In practice, when you generate new models like: `rails g model Dummy born_at:datetime` that'll generate the model, migration, spec, and it'll also add born_at to your factory, which is super handy :)
Really enjoying these testing videos. ?You make it all crystal clear. Thank you!
Great tutorial! Thank you so much.
Extremely well done! I watch with 75% speed.
very detailed explanations!
great video !!!! in the next video for complex tests can you show examples how i can refactor long tests , and , if is possible create a function or method when i have to build factories with same format, example form4=build.... and these lines are repeated along my tests? . would be nice if teach us some about code coverage with simplecov... thanks in advance,,, channels like yours keep Rails alive.
awesome! Thanks for sharing
Tnx for tutorials, but where can I find form4tracker build videos?
Hi CJ. Which Vim theme are you using? Also which terminal? Whether it is iTerm or Terminal in mac?
One dark is the theme in iTerm. I also set some custom colors on iTerm
How can I test for regular expressions with rspec and shoulda matchers.
is the schema information automatically added to your model file or do you manually add that information?
When you create the model and a migration, and run the migrations, the schema is automatically updated. This is a solid question and something I totally glossed over. Will try to cover this better in the future.
@@cjav_dev Im familiar with the schema being created, but Ive never come across the table details in the model like you have here. I even ran a rails g rspec:mode dummy name born_at:integer to see if it was something I may have missed but nothing was there
oh! so if you run `rails g rspec:model Dummy` that'll create the spec file and the factory, but both will be empty, even if the schema has columns. If you run `rails g rspec:model Dummy born_at:integer` that should create the same spec file, but the factory should have a new born_at thing setup for you.
In practice, when you generate new models like: `rails g model Dummy born_at:datetime` that'll generate the model, migration, spec, and it'll also add born_at to your factory, which is super handy :)
It's a gem called Annotate.