小编chi*_*eng的帖子

使用导轨中的capybara单击一个特定按钮

我正在使用rails 3并且目前正在使用selenium驱动程序与capybara进行测试,我的问题如下

在一种形式我有3个按钮名为"保存并添加另一个","保存并继续编辑"和"保存"现在,如果我尝试保存由capybara形式如下

click_button 'Save'
Run Code Online (Sandbox Code Playgroud)

然后这个抛出错误称为"保存"按钮,找不到ID,标题或值现在,如果我删除上面的2个按钮,然后我尝试,然后它的工作原理

仅供参考,我的3按钮的html如下,

<input class="btn" type="submit" value="Save and add another" name="_addanother" data-disable-with="Save and add another">

<input class="btn" type="submit" value="Save and continue editing" name="_continue" data-disable-with="Save and continue editing">

<input class="btn" type="submit" value="Save" name="_save" data-disable-with="Save">

如果有人有想法,请告诉我.

integration-testing rspec ruby-on-rails click capybara

12
推荐指数
1
解决办法
2万
查看次数

获取未定义方法'valid_password?'的错误 与Authlogic

我使用Authlogic在服务器上突然出现以下错误

NoMethodError (undefined method `valid_password?' for #<ProductionHouse:0xb53859cc>):

authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `send'

authlogic (2.1.3) [v] lib/authlogic/session/password.rb:191:in `validate_by_password'

authlogic (2.1.3) [v] lib/authlogic/session/callbacks.rb:72:in `validate'

authlogic (2.1.3) [v] lib/authlogic/session/validation.rb:64:in `valid?'

authlogic (2.1.3) [v] lib/authlogic/session/existence.rb:65:in `save'

app/controllers/user_session_controller.rb:162:in `create'

pdfkit (0.5.1) lib/pdfkit/middleware.rb:16:in `call'
Run Code Online (Sandbox Code Playgroud)

不能突然发生这个问题吗?有没有人知道这个,请帮忙吗?

ruby-on-rails authlogic

8
推荐指数
1
解决办法
1272
查看次数

更改Git Repository以获取拉码

我说有一个存储库abc/myprject.git.我在服务器上有这个repo,我从中获取代码.现在我已经分叉了这个存储库,命名它chirag/myproject.git.

关于这个,我有两个问题:

  1. 我现在想使用chirag/myproject.gitrepo而不是原来的repo,那么如何在服务器上将其更改abc/myproject.git为fork-one chirag/myproject.git
  2. 在我更改了服务器上的repo之后,如果我删除了abc/myproject.git,它会导致任何问题chirag/myproject.git吗?

谢谢

git repository

3
推荐指数
1
解决办法
2742
查看次数

未检出git://github.com/ryanb/nested_form.git(在master中).请运行`bundle install`(Bundler :: GitError)

我已经使用乘客和apache在linux服务器上部署了我的应用程序,我已成功完成捆绑安装运行仍然git://github.com/ryanb/nested_form.git (at master) is not checked out. Please run bundle install (Bundler::GitError)在尝试运行我的应用程序时出现()错误

仅供参考,我使用的是rails 3.2.3和ruby 1.9.3

这在我的开发机器上工作正常

任何的想法 ?

apache deployment production nested-forms ruby-on-rails-3

2
推荐指数
1
解决办法
1366
查看次数