You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
10日でおぼえる Ruby on Rails入門教室 作者: arton出版社/メーカー: 翔泳社発売日: 2008/04/15メディア: 大型本購入: 6人 クリック: 113回この商品を含むブログ (41件) を見るなんか本に書いてあることが全然違うなー。本の内容は1.2なので仕方ないけど。 とりあえず、Scaffoldで生成されたテストを実行するとエラーになります。 % rake tenkoma@tenkoimac (in /Users/tenkoma/NetBeansProjects/memopad) /opt/local/bin/ruby -Ilib:test "/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/memo_test.rb" Loaded sui
テストとは 説明 あるURLにアクセスした際に、予期した画面が表示されるか ある正しい操作をした際に、アプリケーションの状態が正しく変更されるか ある正しくない操作をした際に、適切なエラーメッセージが表示されるか 単体テスト モデルの検索系メソッドが正しい値を取得できるか モデルの更新系メソッドが正しくデータベースを更新できるか モデルの更新系メソッドが不正な入力に対して、適切なエラーを発生させるか 機能テスト 適切なテンプレートが選択されているか インスタンス変数に適切な値が格納されているか 適切にレンダリングされているか 更新系のアクションが正しくデータベースを更新されるか 総合テスト ログインして、新しいメンバーを追加して、ログアウトするといった一連の動きをテスト テストデータ 説明 事前に用意したテストデータを読み込み常にDBの内容を一定に保つための仕組みのことをフィクスチャと呼ぶ
sugino-yasuhiro-no-MacBook-Air:point_blog suginoyasuhiro$ rake db:test:prepare rake aborted! undefined method `prerequisites' for nil:NilClass (See full trace by running task with --trace) StackOverflowにも挙っていたけど、対処方法がよくわからなかったので、bundle updateでRSpecのバージョンを2.5系から2.6系に上げたら直った。よくわからんので、ログを残しておく。 まずは直前にbundle installして、rspec:installをしたときの状態。 $ bundle install Using rake (0.9.2) Using multi_json (1.0.3)
前回は具体的なWebアプリを例にして簡単なコードレビューをしました。今回からは、テストを使ったリファクタリングについて解説していきます 少し時間が空いてしまいましたが、前回は具体的なWebアプリを例にして簡単なコードレビューをしました。今回からは、そのWebアプリに対してテストを書いてリファクタリングする具体的な方法について解説していきます。 今回はまず、Ruby on Railsで人気のあるテストフレームワークの数々についてご紹介します。 最近のテストフレームワークトレンド Hamlの作者として知られるHampton Catlin氏が行った「Hampton's Third Ruby Survey, 2010」の中に、テストに関するいくつかの興味深い結果があります。好きなテストフレームワークは何ですかという質問に対する答えをグラフにすると以下の通りです。 これを見ると「ビヘイビア駆動開発(
Ruby on Rails のテストの書き方のまとめ。 RSpecを使わない,素の unit test (モデルのテスト) functional test(コントローラ+ビューのテスト) について,どう書いたらいいのか,どこの情報を参照したらよいのか,などを列挙。 Rails入門者が初めてテストを書く際に迷わせないようにするためのガイドライン形式。 Railsのバージョンは1.2系を想定。 総説 一度は目を通すべき,入門用のリンク集: RubyOnRails を使ってみる 【第 6 回】 テストの書き方 http://jp.rubyist.net/magazine/?0013-RubyOnRails Railsでテストを書く勘所 http://d.hatena.ne.jp/moro/20061029/1162116778 Railsでのテスト http://d.hatena.ne.jp/a
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く