Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion app/views/layouts/_sidebar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="sidebar-header position-relative">
<div class="d-flex justify-content-between align-items-center">
<div class="logo">
<a href="index.html">Logo</a>
<%= link_to("SkillRx", root_path) %>
</div>
<div class="theme-toggle d-flex gap-2 align-items-center mt-2">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true"
Expand Down Expand Up @@ -38,6 +38,9 @@
<a href="#" class="sidebar-hide d-xl-none d-block"><i class="bi bi-x bi-middle"></i></a>
</div>
</div>
<%= button_to session_path, method: :delete, class: "btn btn-danger mt-2" do %>
<i class="bi bi-box-arrow-right"></i> Log out
<% end %>
</div>

<div class="sidebar-menu">
Expand Down
11 changes: 11 additions & 0 deletions spec/system/login_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,15 @@
expect(page).to have_link("Login", href: new_session_path)
end
end

context "after logging in" do
it "allows users to log out" do
visit new_session_path
fill_in "email", with: user.email
fill_in "password", with: user.password
click_button("Sign in")
click_button("Log out")
expect(page).to have_button("Sign in")
end
end
end