I have 2 Models: Article and Category. Article depends on Category: in order to create Article, I have to create Category first. And I have 4 files: article.features, category.features, article_steps.rb, category_steps.rb
. In somewhere in article_steps.rb
I have to create Category in order to create Article itself. But the code for creating Category has already been defined in category_steps.rb
.
How can I re-use it in article_steps.rb
? I could do that within the same model, but is there any way to do that in different models?
Aucun commentaire:
Enregistrer un commentaire