From 6aae4f75b60fbe4284f909fca5c365f5a448da7e Mon Sep 17 00:00:00 2001 From: frcroth Date: Fri, 5 Feb 2021 11:45:02 +0100 Subject: [PATCH] Improve code quality --- app/views/home/dashboard.html+mobile.erb | 2 +- config/routes.rb | 2 +- spec/requests/chat_spec.rb | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 spec/requests/chat_spec.rb diff --git a/app/views/home/dashboard.html+mobile.erb b/app/views/home/dashboard.html+mobile.erb index a0db041..583861e 100644 --- a/app/views/home/dashboard.html+mobile.erb +++ b/app/views/home/dashboard.html+mobile.erb @@ -7,4 +7,4 @@ <%= render 'users' %> - \ No newline at end of file + diff --git a/config/routes.rb b/config/routes.rb index 190c58e..c8cfac2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,5 +20,5 @@ resources :activities, only: :create resources :jitsi_calls, only: :create - get '/chat', to: 'home#chat', as: 'chat' + 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