Browse Source

add second passing spec

pull/81/head
MadeTech Dushan 3 years ago
parent
commit
e389c8c85e
  1. 14
      spec/features/user_spec.rb

14
spec/features/user_spec.rb

@ -1,10 +1,18 @@
require "rails_helper" require "rails_helper"
RSpec.describe "User Features" do RSpec.describe "User Features" do
let!(:user) { FactoryBot.build(:user) } let!(:user) { FactoryBot.create(:user) }
context "A user navigating to case logs" do context "A user navigating to case logs" do
it " is required to log in" do it " is required to log in" do
visit("/case_logs") visit("/case_logs")
expect(page).to have_current_path("/users/sign_in") 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 end
end end
Loading…
Cancel
Save