diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index 525738f..56b54ae 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -14,6 +14,15 @@ def filter_users_status
@users = @users.sample(maximum_length_user_list)
end
+ def chat
+ if user_signed_in?
+ @room_messages = Room.global_chat_room.room_messages
+ render 'home/chat_page'
+ else
+ render 'index'
+ end
+ end
+
private
def maximum_length_user_list
diff --git a/app/views/home/chat_page.html.erb b/app/views/home/chat_page.html.erb
new file mode 100644
index 0000000..5faa887
--- /dev/null
+++ b/app/views/home/chat_page.html.erb
@@ -0,0 +1,5 @@
+<%= stylesheet_link_tag 'home', media: 'all', 'data-turbolinks-track': 'reload' %>
+<%= stylesheet_link_tag 'home_mobile', media: 'all', 'data-turbolinks-track': 'reload' %>
+
+
+<%= render 'chat' %>
diff --git a/app/views/home/dashboard.html+mobile.erb b/app/views/home/dashboard.html+mobile.erb
index 063a8f6..583861e 100644
--- a/app/views/home/dashboard.html+mobile.erb
+++ b/app/views/home/dashboard.html+mobile.erb
@@ -3,25 +3,8 @@
-
-
+
<%= render 'users' %>
-
- <%= render 'chat' %>
-
-
-
-
-
\ No newline at end of file
+
diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb
index da7a9fc..2acae9d 100644
--- a/app/views/layouts/_footer.html.erb
+++ b/app/views/layouts/_footer.html.erb
@@ -2,17 +2,16 @@
-
-
-
-
-
+
-
-
+
-
@@ -21,7 +20,8 @@
-
-
+
diff --git a/config/routes.rb b/config/routes.rb
index 413e5d9..c8cfac2 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -19,4 +19,6 @@
resources :activities, only: :create
resources :jitsi_calls, only: :create
+
+ get 'chat', to: 'home#chat'
end
diff --git a/spec/requests/chat_spec.rb b/spec/requests/chat_spec.rb
new file mode 100644
index 0000000..5996351
--- /dev/null
+++ b/spec/requests/chat_spec.rb
@@ -0,0 +1,22 @@
+require 'rails_helper'
+
+RSpec.describe 'Chat', type: :request do
+ let(:user) { FactoryBot.create :user }
+
+ describe 'GET chat/' do
+ context 'when signed in' do
+ it 'returns http success' do
+ sign_in user
+ get chat_path
+ expect(response).to have_http_status(:success)
+ end
+ end
+
+ context 'when not signed in' do
+ it 'returns http success' do
+ get chat_path
+ expect(response).to have_http_status(:success)
+ end
+ end
+ end
+end