Hello,
On a website I created the is two commentable model, "project" and
"actuality". You can view pages here :
http://comment-my-projects.herokuapp.com/projects/1-comment-my-projects and
here :
http://comment-my-projects.herokuapp.com/projects/1-comment-my-projects/actualities/1-refactoring-des-specs-du-controller(only
in french for the momeent).
At the end of each page there is a form to create a new comment and a list
for all comments. They have the same behaviour and they use the same
partials. My problem is for specs. I created two specs. Here :
https://github.com/GCorbel/comment-my-projects/blob/master/spec/requests/project_comments_spec.rband
here :
https://github.com/GCorbel/comment-my-projects/blob/master/spec/requests/actuality_comments_spec.rb.
There is a duplication and I want, if it''s possible, to have only one
spec
for this.
I tried to create an engine but I''m not satisfied. The behaviour is
really
related to my application. For example, I have this inherited routes like
this :
resources :actualities do
resources :comments
end
resources :projects do
resources :comments
end
If I try to put only "resources :comments" it break my
controller''s code.
To find the related model I must to add the class name into the params. I
didn''t find another solution and I think it''s uggly.
Do you have and Idea? Is it better to have two specs for a similar feature
or is it better to remove an spec and keep the other?
Thanks for your help!
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.