diff --git a/spec/controllers/statistics_controller_spec.rb b/spec/controllers/statistics_controller_spec.rb new file mode 100644 index 00000000..c193315d --- /dev/null +++ b/spec/controllers/statistics_controller_spec.rb @@ -0,0 +1,34 @@ +require 'rails_helper' + +describe StatisticsController do + let(:user) { FactoryBot.create(:admin) } + before(:each) { allow(controller).to receive(:current_user).and_return(user) } + + [:show, :graphs].each do |route| + describe "GET ##{route}" do + before(:each) { get route } + + expect_status(200) + expect_template(route) + end + end + + [:user_activity_history, :rfc_activity_history].each do |route| + describe "GET ##{route}" do + before(:each) { get route } + + expect_status(200) + expect_template(:activity_history) + end + end + + [:show, :user_activity, :user_activity_history, :rfc_activity, :rfc_activity_history].each do |route| + describe "GET ##{route}.json" do + before(:each) { get route, format: :json } + + expect_status(200) + expect_json + end + end + +end