gpt4 book ai didi

ruby-on-rails - 无法让 save_and_open_page 在 rspec 中为错字项目工作

转载 作者:行者123 更新时间:2023-12-04 05:22:53 25 4
gpt4 key购买 nike

所以我正在做 EdX 第 2 部分作业 1,我似乎无法让 save_and_open_page 工作。

这是 rspec 块:

    describe 'merge action' do

before do
@article_for_merging = Factory(:article)
@article_for_merging.body = 'something we will merge'
end

it 'should merge articles' do
get :merge, 'id' => @article.id, 'merge_with' => @article_for_merging.id
response.should render_template('new')
assigns(:article).should_not be_nil
assigns(:article).should be_valid
response.should contain(/body/)
response.should contain(/extended content/)
save_and_open_page
debugger
response.should have_field('article[body]',:with => @article.body + @article_for_merging.body)
response.should have_selector('form#merge input#merge_with')
response.should have_selector('form#merge input#merge')
end
end

其他堆栈溢出帖子提出了解决方案:

RSpec2 and Capybara

http://paikialog.wordpress.com/2012/02/11/webrat-no-such-file-to-load-action_controllerintegration/

save_and_open_page (capybara / launchy) stopped working in a project - error

我相信我已经尝试了所有方法,但我无法让它发挥作用。这令人沮丧,因为我可以查看原始 HTML,但是对于大页面,找出我需要的 html 详细信息非常痛苦 - 在浏览器中查看诸如 chrome 的“检查元素”之类的东西要容易得多。

无论我尝试过哪些建议解决方案的组合,我都会不断地回到这个错误的一些变化:

1) Admin::ContentController with admin connection merge action 应该合并文章
失败/错误:save_and_open_page
加载错误:
没有要加载的文件 -- action_controller/integration
# ./spec/controllers/admin/content_controller_spec.rb:498:in `block (4 levels) in '

非常感谢任何帮助

最佳答案

关于ruby-on-rails - 无法让 save_and_open_page 在 rspec 中为错字项目工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13518855/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com