- <%= link_to root_path, class: "mr-8" do %>
- <%= image_tag "logo.svg", alt: "Family Funds Logo", class: "h-8" %>
- <% end %>
-
- <% if Current.user.registered? %>
- - <%= link_to "Dashboard", root_path, class: "text-white" %>
- - <%= link_to "Expenses", expenses_path, class: "text-white" %>
- - <%= link_to "Credit Card Bills", credit_card_bills_path, class: "text-white" %>
- - <%= link_to "Incomes", incomes_path, class: "text-white" %>
- - <%= link_to "Members", members_path, class: "text-white" %>
- - <%= link_to "Log out", session_path, data: {turbo_method: :delete}, class: "text-white" %>
- <% else %>
- - <%= link_to "Sign up", new_user_path, class: "text-white" %>
- - <%= link_to "Log in", new_session_path, class: "text-white" %>
- <% end %>
-
+
diff --git a/app/views/shared/_user_dropdown.html.erb b/app/views/shared/_user_dropdown.html.erb
new file mode 100644
index 0000000..590d008
--- /dev/null
+++ b/app/views/shared/_user_dropdown.html.erb
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+ <%= link_to user_path(Current.user), class: "flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" do %>
+
+ Profile
+ <% end %>
+
+ <%= link_to session_path,
+ data: {turbo_method: :delete},
+ class: "flex items-center px-4 py-2 text-sm text-gray-700 hover:bg-gray-100" do %>
+
+ Log out
+ <% end %>
+
+
+
\ No newline at end of file
diff --git a/test/system/credit_card_bills_test.rb b/test/system/credit_card_bills_test.rb
index 5c829c8..ec2fb7e 100644
--- a/test/system/credit_card_bills_test.rb
+++ b/test/system/credit_card_bills_test.rb
@@ -37,7 +37,7 @@ class CreditCardBillsTest < ApplicationSystemTestCase
test "should destroy Credit card bill" do
visit credit_card_bill_url(@credit_card_bill)
- click_on "Delete credit card bill", match: :first
+ accept_prompt { click_on "Delete credit card bill", match: :first }
assert_text "Credit card bill was successfully destroyed"
end
diff --git a/test/system/expenses_test.rb b/test/system/expenses_test.rb
index d23f851..ba276bf 100644
--- a/test/system/expenses_test.rb
+++ b/test/system/expenses_test.rb
@@ -47,7 +47,7 @@ class ExpensesTest < ApplicationSystemTestCase
test "should destroy Expense" do
visit expense_url(@expense)
- click_on "Delete expense", match: :first
+ accept_prompt { click_on "Delete expense", match: :first }
assert_text "Expense was successfully destroyed"
end
diff --git a/test/system/sessions_test.rb b/test/system/sessions_test.rb
index 958d1a5..e1d531b 100644
--- a/test/system/sessions_test.rb
+++ b/test/system/sessions_test.rb
@@ -15,6 +15,8 @@ class SessionsTest < ApplicationSystemTestCase
login(@user.email)
visit root_url
+ # Open the user dropdown by clicking the checkbox label
+ find('label[for="user-dropdown"]').click
click_on "Log out", match: :first
assert_text "Session was successfully destroyed"