From 8b8665ecc7594ae85c118b0baa2d7a597fed8355 Mon Sep 17 00:00:00 2001 From: MadeTech Dushan Date: Wed, 3 Nov 2021 11:51:54 +0000 Subject: [PATCH] add second passing spec --- spec/features/user_spec.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index d87c4bd6a..ff47a3bf6 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -1,10 +1,18 @@ require "rails_helper" RSpec.describe "User Features" do - let!(:user) { FactoryBot.build(:user) } + let!(:user) { FactoryBot.create(:user) } context "A user navigating to case logs" do it " is required to log in" do - visit("/case_logs") - expect(page).to have_current_path("/users/sign_in") + visit("/case_logs") + expect(page).to have_current_path("/users/sign_in") end + + it " is redirected to case logs after signing in" do + visit("/case_logs") + fill_in("user_email", with: "test@example.com") + fill_in("user_password", with: "pAssword1") + click_button("Log in") + expect(page).to have_current_path("/case_logs") + end end end \ No newline at end of file