我用rbenv安装了Ruby 1.9.3-p286.现在,在安装了较新版本(p327)之后,很明显,它对以前版本安装的GEM一无所知.
是否可以将Gems从该版本复制到较新版本,以便不再需要将它们全部下载?
我在评论视图中有一个链接,用于回复此类评论:
<%= link_to t('.reply', :default => t("helpers.links.reply")), new_story_comment_path(comment.story, parent_id: comment)%>
Run Code Online (Sandbox Code Playgroud)
测试的某些部分是这样的:
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
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
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 ==)
# ./spec/requests/comments_spec.rb:23:in `block (2 levels) in <top (required)>'
Run Code Online (Sandbox Code Playgroud)
我用save_and_open_page检查了页面,链接正确:
file:///stories/1/comments/new?parent_id=1
Run Code Online (Sandbox Code Playgroud)
我还检查了test.log文件,我可以看到这一行:
Started GET "/stories/1/comments/new?parent_id=1" for 127.0.0.1 at 2012-09-02 21:05:57
Run Code Online (Sandbox Code Playgroud)
为什么我每次都会收到此错误,而它应该是正确的?