I have a link in my comment view to respond to such a comment:
<%= link_to t('.reply', :default => t("helpers.links.reply")), new_story_comment_path(comment.story, parent_id: comment)%>
Some part of the test is as follows:
it "replies to a comment" do
comment = FactoryGirl.create :comment, story_id: story.id, user_id: user.id
visit story_path story
save_and_open_page
click_link "reply"
current_path.should eq(new_story_comment_path story.id, parent_id: comment.id)
...
end
I get this error:
1) Comments replies to a comment
Failure/Error: current_path.should eq(new_story_comment_path story.id, parent_id: comment.id)
expected: "/stories/1/comments/new?parent_id=1"
got: "/stories/1/comments/new"
(compared using ==)
I checked the page with save_and_open_page and the link is correct:
file:///stories/1/comments/new?parent_id=1
I also checked the test.log file and I see this line:
Started GET "/stories/1/comments/new?parent_id=1" for 127.0.0.1 at 2012-09-02 21:05:57
Why do I get this error every time, although it should be correct?
source
share