\ No newline at end of file
diff --git a/app/views/games/_all_pages_nav.html.erb b/app/views/games/_all_pages_nav.html.erb
index 7714854c..a6e5921c 100644
--- a/app/views/games/_all_pages_nav.html.erb
+++ b/app/views/games/_all_pages_nav.html.erb
@@ -26,7 +26,7 @@
diff --git a/config/routes.rb b/config/routes.rb
index 41a42f3a..62ef0bb3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -22,4 +22,6 @@
get "/spellingbee/:id", to: "games#demo_game", as: "spellingbee"
get "/wordle/:id", to: "games#demo_game", as: "wordle"
get "/letterboxed/:id", to: "games#demo_game", as: "letterboxed"
+
+ get 'dashboard', to: 'dashboard#show', as: 'dashboard'
end
diff --git a/features/dashboard.feature b/features/dashboard.feature
new file mode 100644
index 00000000..67e6db5e
--- /dev/null
+++ b/features/dashboard.feature
@@ -0,0 +1,17 @@
+Feature: Dashboard
+
+ Background:
+ Given I am logged into Arcade
+
+ Scenario: Viewing the dashboard
+ When I visit the dashboard page
+ Then I should see "Welcome to Your Dashboard!"
+ And I should see "Total Games Played"
+ And I should see "Total Games Won"
+ And I should see "Last Played"
+ And I should see "Wordle"
+
+ Scenario: Guest user tries to access dashboard
+ Given I am a guest user
+ When I try to visit the dashboard page
+ Then I should see "Welcome, Guest!"
diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb
new file mode 100644
index 00000000..2fdc080c
--- /dev/null
+++ b/features/step_definitions/dashboard_steps.rb
@@ -0,0 +1,30 @@
+When('I visit the dashboard page') do
+ visit dashboard_path
+ end
+
+ Then('I should see the dashboard message {string}') do |message|
+ expect(page).to have_content(message)
+ end
+
+ Then('I should see a list of games including {string}, {string}, and {string}') do |game1, game2, game3|
+ expect(page).to have_content(game1)
+ expect(page).to have_content(game2)
+ expect(page).to have_content(game3)
+ end
+
+ # New steps for guest user scenario
+
+ Given('I am a guest user') do
+ # Simulating the user as a guest by visiting the guest path which sets session[:guest]
+ visit guest_path # This path should be the one that sets session[:guest] to true
+ end
+
+ When('I try to visit the dashboard page') do
+ visit dashboard_path
+ end
+
+ Then('I should be redirected to {string}') do |message|
+ # Check if the user is redirected to the welcome page and sees the expected message
+ expect(page).to have_content(message)
+ end
+
\ No newline at end of file
diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb
new file mode 100644
index 00000000..6dd660e9
--- /dev/null
+++ b/spec/controllers/dashboard_controller_spec.rb
@@ -0,0 +1,38 @@
+require 'rails_helper'
+
+RSpec.describe DashboardController, type: :controller do
+ let(:user) { double('User', id: 1) }
+
+ before do
+ # Mock the logged_in? method to simulate a logged-in user
+ allow(controller).to receive(:logged_in?).and_return(true)
+
+ # Mock current_user to return the simulated user
+ allow(controller).to receive(:current_user).and_return(user)
+
+ # Mock time_ago_in_words to return a static value
+ allow(controller).to receive(:time_ago_in_words).and_return('12h ago')
+
+ # Perform the GET request
+ get :show
+ end
+
+ describe 'GET #show' do
+ it 'renders the show template' do
+ expect(response).to render_template(:show)
+ end
+
+ it 'assigns @dummy_dashboard' do
+ expect(assigns(:dummy_dashboard)).not_to be_nil
+ expect(assigns(:dummy_dashboard)[:total_games_played]).to eq(950)
+ expect(assigns(:dummy_dashboard)[:total_games_won]).to eq(450)
+ expect(assigns(:dummy_dashboard)[:last_played]).to eq('12h ago')
+ end
+
+ it 'assigns @dummy_games' do
+ expect(assigns(:dummy_games)).not_to be_nil
+ expect(assigns(:dummy_games).size).to eq(3)
+ expect(assigns(:dummy_games).first[:name]).to eq('Worldle')
+ end
+ end
+end
From c448b22efe35215cf8060849fefe99b4bb1d0040 Mon Sep 17 00:00:00 2001
From: Kanishk Chhabra <67221487+mrkc2303@users.noreply.github.com>
Date: Fri, 4 Oct 2024 20:13:00 -0500
Subject: [PATCH 2/5] fix: Fixed one Rspec senario
---
spec/controllers/dashboard_controller_spec.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb
index 6dd660e9..f6624087 100644
--- a/spec/controllers/dashboard_controller_spec.rb
+++ b/spec/controllers/dashboard_controller_spec.rb
@@ -32,7 +32,7 @@
it 'assigns @dummy_games' do
expect(assigns(:dummy_games)).not_to be_nil
expect(assigns(:dummy_games).size).to eq(3)
- expect(assigns(:dummy_games).first[:name]).to eq('Worldle')
+ expect(assigns(:dummy_games).first[:name]).to eq('Spelling Bee')
end
end
end
From 072eae19a7989b4f3f9556d845e2c6c3d374b07d Mon Sep 17 00:00:00 2001
From: Kanishk Chhabra <67221487+mrkc2303@users.noreply.github.com>
Date: Fri, 4 Oct 2024 20:21:59 -0500
Subject: [PATCH 3/5] doc: Documentation fixes and cleaning
---
README.md | 95 ++++---------------
TEAM_WORK_AGREEMENT.md | 80 ++++++++++++++++
documentation/{Fall2024 => }/sprint1plan.pdf | Bin
3 files changed, 99 insertions(+), 76 deletions(-)
create mode 100644 TEAM_WORK_AGREEMENT.md
rename documentation/{Fall2024 => }/sprint1plan.pdf (100%)
diff --git a/README.md b/README.md
index f8e6474b..64fbf445 100644
--- a/README.md
+++ b/README.md
@@ -1,87 +1,30 @@
-# Important Links
-- **Deployed App:** https://csce606arcade-12ac8dd4dc24.herokuapp.com/users
-- **Code Climate Report:** https://codeclimate.com/github/tamu-edu-students/csce600-arcade
-- **Project Management Page:** https://tamu-team-pyr0027e.atlassian.net/jira/software/projects/SCRUM/boards/1
+# ARCADE
+
+## Project Overview
+
+The development of Arcade is driven by the vision of our primary customer, Prof. Ritchey. Prof. Ritchey was frustrated with the monetization of platforms like the New York Times games, which require users to log in and pay for access. These barriers not only make the experience cumbersome but also limit accessibility for many users.
+
+In response, we are currently developing Arcade, an application that will offer a collection of games similar to those on the New York Times platform, but with free access and no mandatory login requirements. Users will be able to enjoy these games without creating an account or paying any fees, ensuring a seamless and unrestricted experience.
+
+Arcade will also include an optional login feature to enhance the user experience. Logged-in users will have the ability to save their progress and view rankings across various games. However, the login remains optional, allowing users to enjoy the platform without any obligations if they prefer.
+
+This project aligns with Prof. Ritchey’s goal of creating a more accessible, user-friendly gaming experience, free from the frustrations caused by monetized platforms.
-# Team Working Agreement
## Team Information
- **Client:** Dr. Ritchey
- **Client Meetings:** Every Thursday, 4 PM - 5 PM, via Zoom
- **Developers:** Kanishk Chhabra, Nandinii Yeleswarapu, Tejas Singhal, Krishna Calindi, Junchao, Ze Sheng, Antonio
+
## Sprint - 1
- **Product Owner:** Tejas Singhal
- **Scrum Master:** Nandinii Yeleswarapu
-## Purpose
-This agreement outlines the team's shared understanding of collaboration, communication, and delivery to ensure we meet our goals and provide value effectively. It reflects our commitment to the Scrum values: **Commitment**, **Focus**, **Openness**, **Respect**, and **Courage**.
-## Key Values
-### 1. **Commitment**
-- Each team member is responsible for completing their assigned story points within the sprint.
-- Team members ensure transparency by updating their tasks daily in the project management tool.
-- Everyone commits to attending daily stand-ups, sprint planning, reviews, and retrospectives on time.
-### 2. **Focus**
-- We will concentrate on sprint goals, ensuring our efforts contribute directly to the current sprint backlog.
-- During core collaboration hours, team members should minimize distractions and focus on assigned tasks.
-### 3. **Openness**
-- Progress will be shared openly during stand-ups, especially blockers that require team support.
-- Transparent communication is encouraged, whether it's about issues, delays, or new ideas.
-- All feedback is valuable. We will create an environment where all ideas and perspectives are heard and respected.
-### 4. **Respect**
-- Respect each team member's time by being punctual for meetings and providing timely updates on tasks.
-- Ensure all voices are heard during meetings, promoting inclusivity and collaboration.
-### 5. **Courage**
-- Team members are encouraged to take on challenging tasks and continue learning.
-- We will embrace constructive criticism and use it to improve our processes and outputs.
-## Working Hours
-- **Core Hours:** 4 PM - 10 PM (team members are expected to be available for collaboration).
-- **Flexible Hours:** Outside core hours, team members may work at their convenience but must ensure sprint commitments are met.
-## Communication Guidelines
-- **Primary Tool:** Slack (for daily updates, queries, and informal communication).
-- **Project Management:** Tasks and progress will be tracked using Jira.
-- **Email:** Used for formal communication with external stakeholders (e.g., client).
-- **Video Conferencing:** Slack Huddle for team meetings and daily stand-ups, Zoom for client meetings.
-### Communication Expectations:
-- **Slack:** Respond within 2 hours during core working hours.
-- **Email:** Respond within 1 business day.
-- **Stand-ups:** Attend daily at 10:00 AM CST, sharing progress, blockers, and plans for the day.
-## Meetings
-- **Daily Stand-up:** Focus on what was completed, upcoming tasks, and any blockers.
-- **Client Meeting:** Thursdays, 4 PM - 5 PM via Zoom. Prepare key updates and questions in advance.
-- **Sprint Review & Retrospective:** End of each sprint, typically on Fridays, 3 PM - 6 PM. Review what went well, and what didn't, and identify action points for improvement.
-## Definition of Completion
-- All tasks must meet the acceptance criteria outlined in the user story.
-- Code must be reviewed and merged into the main branch, with relevant documentation updated.
-- Feature deployment must be tested in the staging environment before presenting to the client.
-## Tools and Resources
-- **Code Repository:** GitHub (all code changes should follow GitFlow and include peer code reviews).
-- **Deployed Application:** Regular updates are required to ensure the app reflects the current progress.
-- **Project Management Tool:** Jira is used to track tasks, story points, and overall progress.
-## Collaboration Practices
-- Pair programming or team collaboration is encouraged for complex tasks.
-- All features should undergo a review process before being merged into the codebase.
-- If you encounter a blocker, communicate it early and seek assistance from team members or the Scrum Master.
-## Risk and Escalation
-- For unexpected risks or delays, promptly communicate with the Scrum Master or Product Owner.
-- If a risk may affect delivery, it will be discussed during the next stand-up or relevant meeting.
-## Client Feedback Process
-- Feedback from the client, Dr. Ritchey, will be reviewed and incorporated into our sprint planning.
-- Action points from the client meeting will be documented and shared with the team via Jira or Slack.
-## SDLC for this project
-1. `main` is the top level branch for this project and maintains the latest fully tested working
- copy of the codespace and should be deployable at any time.
-2. When picking up a new ticket, checkout a new branch off of `main` and commit all your code to that branch
- a. When the code is ready, **ensure all acceptance and unit tests are passing for the whole project**,
- pull the latest version of `main`, merge `main` into your feature branch, resolve any merge conflicts,
- ensure build is successful then push your code to github and create a pull request.
- b. Assign a developer in the team to review the code
- c. Once reviewed, merge your feature branch back to `main` and delete your feature branch.
-3. Everytime code is merged to the `main` branch, Acceptance tests and Unit tests will be run on
- on `main` to ensure we still have a woring copy of the code. If the tests fail, we fix the defects
- before any new feature work is picked up. If the tests run succesfully, we deploy `main` to Heroku.
-4. When we are ready to deploy, we merge `main` into `prod` and CICD takes care of the deployment.
-## Revisiting the Agreement
-This working agreement is a living document. The team will review and adjust it at the start of each sprint during Sprint Planning to ensure it reflects our evolving needs.
----
-Team Arcade is committed to upholding this agreement and collaborating effectively to deliver value to our client, Dr. Ritchey.
+- [Sprint 1 Plan](./documentation/sprint1plan.pdf)
+
+# Important Links
+- [Team Working Agreement](TEAM_WORK_AGREEMENT.md)
+- **Deployed App:** https://csce606arcade-12ac8dd4dc24.herokuapp.com/users
+- **Code Climate Report:** https://codeclimate.com/github/tamu-edu-students/csce600-arcade
+- **Project Management Page:** https://tamu-team-pyr0027e.atlassian.net/jira/software/projects/SCRUM/boards/1
## Software dependencies and version
**Ruby** - 3.3.4
diff --git a/TEAM_WORK_AGREEMENT.md b/TEAM_WORK_AGREEMENT.md
new file mode 100644
index 00000000..9cb30818
--- /dev/null
+++ b/TEAM_WORK_AGREEMENT.md
@@ -0,0 +1,80 @@
+
+# Team Working Agreement
+## Team Information
+- **Client:** Dr. Ritchey
+- **Client Meetings:** Every Thursday, 4 PM - 5 PM, via Zoom
+- **Developers:** Kanishk Chhabra, Nandinii Yeleswarapu, Tejas Singhal, Krishna Calindi, Junchao, Ze Sheng, Antonio
+## Sprint - 1
+- **Product Owner:** Tejas Singhal
+- **Scrum Master:** Nandinii Yeleswarapu
+## Purpose
+This agreement outlines the team's shared understanding of collaboration, communication, and delivery to ensure we meet our goals and provide value effectively. It reflects our commitment to the Scrum values: **Commitment**, **Focus**, **Openness**, **Respect**, and **Courage**.
+## Key Values
+### 1. **Commitment**
+- Each team member is responsible for completing their assigned story points within the sprint.
+- Team members ensure transparency by updating their tasks daily in the project management tool.
+- Everyone commits to attending daily stand-ups, sprint planning, reviews, and retrospectives on time.
+### 2. **Focus**
+- We will concentrate on sprint goals, ensuring our efforts contribute directly to the current sprint backlog.
+- During core collaboration hours, team members should minimize distractions and focus on assigned tasks.
+### 3. **Openness**
+- Progress will be shared openly during stand-ups, especially blockers that require team support.
+- Transparent communication is encouraged, whether it's about issues, delays, or new ideas.
+- All feedback is valuable. We will create an environment where all ideas and perspectives are heard and respected.
+### 4. **Respect**
+- Respect each team member's time by being punctual for meetings and providing timely updates on tasks.
+- Ensure all voices are heard during meetings, promoting inclusivity and collaboration.
+### 5. **Courage**
+- Team members are encouraged to take on challenging tasks and continue learning.
+- We will embrace constructive criticism and use it to improve our processes and outputs.
+## Working Hours
+- **Core Hours:** 4 PM - 10 PM (team members are expected to be available for collaboration).
+- **Flexible Hours:** Outside core hours, team members may work at their convenience but must ensure sprint commitments are met.
+## Communication Guidelines
+- **Primary Tool:** Slack (for daily updates, queries, and informal communication).
+- **Project Management:** Tasks and progress will be tracked using Jira.
+- **Email:** Used for formal communication with external stakeholders (e.g., client).
+- **Video Conferencing:** Slack Huddle for team meetings and daily stand-ups, Zoom for client meetings.
+### Communication Expectations:
+- **Slack:** Respond within 2 hours during core working hours.
+- **Email:** Respond within 1 business day.
+- **Stand-ups:** Attend daily at 10:00 AM CST, sharing progress, blockers, and plans for the day.
+## Meetings
+- **Daily Stand-up:** Focus on what was completed, upcoming tasks, and any blockers.
+- **Client Meeting:** Thursdays, 4 PM - 5 PM via Zoom. Prepare key updates and questions in advance.
+- **Sprint Review & Retrospective:** End of each sprint, typically on Fridays, 3 PM - 6 PM. Review what went well, and what didn't, and identify action points for improvement.
+## Definition of Completion
+- All tasks must meet the acceptance criteria outlined in the user story.
+- Code must be reviewed and merged into the main branch, with relevant documentation updated.
+- Feature deployment must be tested in the staging environment before presenting to the client.
+## Tools and Resources
+- **Code Repository:** GitHub (all code changes should follow GitFlow and include peer code reviews).
+- **Deployed Application:** Regular updates are required to ensure the app reflects the current progress.
+- **Project Management Tool:** Jira is used to track tasks, story points, and overall progress.
+## Collaboration Practices
+- Pair programming or team collaboration is encouraged for complex tasks.
+- All features should undergo a review process before being merged into the codebase.
+- If you encounter a blocker, communicate it early and seek assistance from team members or the Scrum Master.
+## Risk and Escalation
+- For unexpected risks or delays, promptly communicate with the Scrum Master or Product Owner.
+- If a risk may affect delivery, it will be discussed during the next stand-up or relevant meeting.
+## Client Feedback Process
+- Feedback from the client, Dr. Ritchey, will be reviewed and incorporated into our sprint planning.
+- Action points from the client meeting will be documented and shared with the team via Jira or Slack.
+## SDLC for this project
+1. `main` is the top level branch for this project and maintains the latest fully tested working
+ copy of the codespace and should be deployable at any time.
+2. When picking up a new ticket, checkout a new branch off of `main` and commit all your code to that branch
+ a. When the code is ready, **ensure all acceptance and unit tests are passing for the whole project**,
+ pull the latest version of `main`, merge `main` into your feature branch, resolve any merge conflicts,
+ ensure build is successful then push your code to github and create a pull request.
+ b. Assign a developer in the team to review the code
+ c. Once reviewed, merge your feature branch back to `main` and delete your feature branch.
+3. Everytime code is merged to the `main` branch, Acceptance tests and Unit tests will be run on
+ on `main` to ensure we still have a woring copy of the code. If the tests fail, we fix the defects
+ before any new feature work is picked up. If the tests run succesfully, we deploy `main` to Heroku.
+4. When we are ready to deploy, we merge `main` into `prod` and CICD takes care of the deployment.
+## Revisiting the Agreement
+This working agreement is a living document. The team will review and adjust it at the start of each sprint during Sprint Planning to ensure it reflects our evolving needs.
+---
+Team Arcade is committed to upholding this agreement and collaborating effectively to deliver value to our client, Dr. Ritchey.
diff --git a/documentation/Fall2024/sprint1plan.pdf b/documentation/sprint1plan.pdf
similarity index 100%
rename from documentation/Fall2024/sprint1plan.pdf
rename to documentation/sprint1plan.pdf
From 3820c23455a038211e82f5ad103baffd514a0681 Mon Sep 17 00:00:00 2001
From: Kanishk Chhabra <67221487+mrkc2303@users.noreply.github.com>
Date: Fri, 4 Oct 2024 20:24:10 -0500
Subject: [PATCH 4/5] doc: final documentation changes
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 64fbf445..b2e317ca 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ This project aligns with Prof. Ritchey’s goal of creating a more accessible, u
## Sprint - 1
- **Product Owner:** Tejas Singhal
- **Scrum Master:** Nandinii Yeleswarapu
-- [Sprint 1 Plan](./documentation/sprint1plan.pdf)
+- [Sprint 1 Plan](./documentation)
# Important Links
- [Team Working Agreement](TEAM_WORK_AGREEMENT.md)
@@ -27,6 +27,6 @@ This project aligns with Prof. Ritchey’s goal of creating a more accessible, u
- **Project Management Page:** https://tamu-team-pyr0027e.atlassian.net/jira/software/projects/SCRUM/boards/1
## Software dependencies and version
-**Ruby** - 3.3.4
-**Rails** - 7.2.1
+**Ruby** - 3.3.4 \
+**Rails** - 7.2.1 \
**Rack** - 3.1.7
From 7a5581736c223a7438411bf3401edbdefab77a2f Mon Sep 17 00:00:00 2001
From: Kanishk Chhabra <67221487+mrkc2303@users.noreply.github.com>
Date: Fri, 4 Oct 2024 20:27:24 -0500
Subject: [PATCH 5/5] robocop code correction
---
app/controllers/dashboard_controller.rb | 20 ++++++++++----------
app/models/dashboard.rb | 4 ++--
config/routes.rb | 2 +-
features/step_definitions/dashboard_steps.rb | 13 ++++++-------
4 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index d73a0919..007da9b8 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -1,29 +1,29 @@
class DashboardController < ApplicationController
- before_action :require_login, only: [:show]
-
+ before_action :require_login, only: [ :show ]
+
def show
# Dummy data to simulate user statistics
@dummy_dashboard = {
user_id: 1,
total_games_played: 950,
total_games_won: 450,
- last_played: time_ago_in_words(Time.parse('2024-09-27')),
+ last_played: time_ago_in_words(Time.parse("2024-09-27")),
current_streak: 12,
longest_streak: 15
}
-
+
# Dummy data to simulate game history
@dummy_games = [
- { name: 'Spelling Bee', played_on: '2024-09-27', status: 'Won', points: 1354 },
- { name: 'Wordle', played_on: '2024-09-27', status: 'Won', points: 1354 },
- { name: 'Letter Boxed', played_on: '2024-09-27', status: 'Won', points: 1354 }
+ { name: "Spelling Bee", played_on: "2024-09-27", status: "Won", points: 1354 },
+ { name: "Wordle", played_on: "2024-09-27", status: "Won", points: 1354 },
+ { name: "Letter Boxed", played_on: "2024-09-27", status: "Won", points: 1354 }
]
end
-
+
private
def time_ago_in_words(from_time)
distance_in_minutes = ((Time.now - from_time) / 60).to_i
-
+
case distance_in_minutes
when 0..59
"#{distance_in_minutes}m ago" # Minutes ago
@@ -33,4 +33,4 @@ def time_ago_in_words(from_time)
"#{distance_in_minutes / 1440}d ago" # Days ago
end
end
- end
\ No newline at end of file
+end
diff --git a/app/models/dashboard.rb b/app/models/dashboard.rb
index 12cc1678..da4aa389 100644
--- a/app/models/dashboard.rb
+++ b/app/models/dashboard.rb
@@ -1,7 +1,7 @@
class Dashboard < ApplicationRecord
# belongs_to :user
# has_many :games
-
+
def update_statistics(game)
self.total_games_played += 1
self.total_games_won += 1 if game.won?
@@ -9,4 +9,4 @@ def update_statistics(game)
# Logic for streaks goes here
self.save
end
- end
\ No newline at end of file
+end
diff --git a/config/routes.rb b/config/routes.rb
index 62ef0bb3..eff6f978 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -23,5 +23,5 @@
get "/wordle/:id", to: "games#demo_game", as: "wordle"
get "/letterboxed/:id", to: "games#demo_game", as: "letterboxed"
- get 'dashboard', to: 'dashboard#show', as: 'dashboard'
+ get "dashboard", to: "dashboard#show", as: "dashboard"
end
diff --git a/features/step_definitions/dashboard_steps.rb b/features/step_definitions/dashboard_steps.rb
index 2fdc080c..b6f6f628 100644
--- a/features/step_definitions/dashboard_steps.rb
+++ b/features/step_definitions/dashboard_steps.rb
@@ -1,30 +1,29 @@
When('I visit the dashboard page') do
visit dashboard_path
end
-
+
Then('I should see the dashboard message {string}') do |message|
expect(page).to have_content(message)
end
-
+
Then('I should see a list of games including {string}, {string}, and {string}') do |game1, game2, game3|
expect(page).to have_content(game1)
expect(page).to have_content(game2)
expect(page).to have_content(game3)
end
-
+
# New steps for guest user scenario
-
+
Given('I am a guest user') do
# Simulating the user as a guest by visiting the guest path which sets session[:guest]
visit guest_path # This path should be the one that sets session[:guest] to true
end
-
+
When('I try to visit the dashboard page') do
visit dashboard_path
end
-
+
Then('I should be redirected to {string}') do |message|
# Check if the user is redirected to the welcome page and sees the expected message
expect(page).to have_content(message)
end
-
\ No newline at end of file