rspec

ActionMailer::Baseをインスタンス化できない

メモ ActionMailerの単体テストを書こうと思い、最初はActionMailer.deliver_???のテストを書いたが次の点が嫌だなと思った。 ・deliver_???は自分で書いたコードではない(???が自分で書いたコードだ) ・???で設定したビューで使用することを設定したイン…

Rspec 他のメソッド呼ぶスペックの書き方

メモ class A def call_other_method other_method1 end def other_method1 end def other_method2 end end describe A, "#call_other_methodを実行した場合" do before(:each) do @a = A.new end it "other_method1を呼ぶこと" do @a.should_receive(:other…