私のセッションコントローラー
def create
auth = request.env["omniauth.auth"]
person=Person.find_by_provider_and_uid(auth.provider,auth.uid) || Person.create_with_omniauth(auth)
session[:user_id] = person.id
redirect_to root_path
end
def failure
redirect_to signin_path , alert: "Authentication failed, please try again."
end
sessions_controller_test.rb に失敗アクションをテストするためのテストを書きました
it "failure should redirect to signin_path" do
get :failure
assert_redirected_to :action => 'new'
assert_response :redirect
end
しかし、simplecov コード カバレッジ ツールは、このテストを成功として受け入れません。Simplecov は、この失敗アクションをテストの欠落として示します。障害アクションのコントローラー テストを作成するにはどうすればよいですか。誰もこれについて何か考えを与えませんか? 下の画像は取材レポートのスクリーンショットです。