2
在我的數據庫Rails應用程序中我有一些查詢。如何在沒有測試的情況下使用水豚
# PostController
@post.query # => 'blabla'
,我希望把這個字符串在谷歌或雅虎
簡單的ruby文件我用
require ... all gems
Capybara.app_host = 'http://www.google.com/'
和
class Google
include Capybara::DSL
def search
visit('/')
fill_in "q", :with => "blah blah"
click_button("Google")
...
,但我怎麼可以把這個代碼控制器(或模型方法)?
我正在尋找如何使用谷歌與水豚搜索(當我有時間 - 我把答案) –