diff --git a/app/controllers/about_controller.rb b/app/controllers/about_controller.rb index 4a553c07..404a497c 100644 --- a/app/controllers/about_controller.rb +++ b/app/controllers/about_controller.rb @@ -5,16 +5,16 @@ class AboutController < ApplicationController def about user_count = User - .where.not(confirmed_at: nil) - .where("answered_count > 0") - .count + .where.not(confirmed_at: nil) + .where("answered_count > 0") + .count current_ban_count = UserBan - .current - .joins(:user) - .where.not("users.confirmed_at": nil) - .where("users.answered_count > 0") - .count + .current + .joins(:user) + .where.not("users.confirmed_at": nil) + .where("users.answered_count > 0") + .count @users = user_count - current_ban_count @questions = Question.count diff --git a/app/controllers/link_filter_controller.rb b/app/controllers/link_filter_controller.rb index fac0b4e9..f2f1254f 100644 --- a/app/controllers/link_filter_controller.rb +++ b/app/controllers/link_filter_controller.rb @@ -3,7 +3,7 @@ class LinkFilterController < ApplicationController def index redirect_to root_path unless params[:url] - + @link = params[:url] end end diff --git a/app/controllers/timeline_controller.rb b/app/controllers/timeline_controller.rb index 5fe3731a..a7339120 100644 --- a/app/controllers/timeline_controller.rb +++ b/app/controllers/timeline_controller.rb @@ -15,7 +15,7 @@ class TimelineController < ApplicationController end def list - @list = current_user.lists.find_by_name!(params[:list_name]) + @list = current_user.lists.find_by!(name: params[:list_name]) @timeline = @list.cursored_timeline(last_id: params[:last_id]) @timeline_last_id = @timeline.map(&:id).min @more_data_available = !@list.cursored_timeline(last_id: @timeline_last_id, size: 1).count.zero? diff --git a/spec/controllers/about_controller_spec.rb b/spec/controllers/about_controller_spec.rb index 3b9c54c3..f9fecf7b 100644 --- a/spec/controllers/about_controller_spec.rb +++ b/spec/controllers/about_controller_spec.rb @@ -6,12 +6,12 @@ describe AboutController, type: :controller do describe "#about" do subject { get :about } - before(:each) { + before(:each) do FactoryBot.create(:user, { confirmed_at: Time.current, answered_count: 1 }) FactoryBot.create(:user, { confirmed_at: Time.current, answered_count: 1 }).ban FactoryBot.create(:user, { confirmed_at: Time.current }) FactoryBot.create(:user, { confirmed_at: Time.current }).ban - } + end it "shows the correct user count" do subject diff --git a/spec/controllers/link_filter_controller_spec.rb b/spec/controllers/link_filter_controller_spec.rb index 51f34a7c..e6c04217 100644 --- a/spec/controllers/link_filter_controller_spec.rb +++ b/spec/controllers/link_filter_controller_spec.rb @@ -22,4 +22,4 @@ describe LinkFilterController, type: :controller do end end end -end \ No newline at end of file +end