RSpecには統合テストを実行するための便利なメソッド「get」と「response.should」があることを知っています.Rakeタスクでこれら(または同じ結果を達成するための他のメソッド)をどのように使用できるか知りたいです:
desc "Check all content items with type 0 and do something"
task :my_task => :environment do
ContentItem.where("content_type = ?", 0).each do |obj|
get "/my_path/"+obj.value
if (response has a certain html tag)
perform some action on obj
end
end
end
そのような rspec メソッドを実行することはできないことはわかっていますが、これは実際に実行する必要があることであり、/my_path/obj.value を開いたときに返される情報を処理できるようにする必要があります。誰か提案はありますか?