Files
codeocean/spec/controllers/statistics_controller_spec.rb
Sebastian Serth 99bd46af1a Align project files with CodeHarbor
Since both projects are developed together and by the same team, we also want to have the same code structure and utility methods available in both projects. Therefore, this commit changes many files, but without a functional change.
2023-10-11 00:18:33 +02:00

39 lines
840 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe StatisticsController do
render_views
let(:user) { create(:admin) }
before { allow(controller).to receive(:current_user).and_return(user) }
%i[show graphs].each do |route|
describe "GET ##{route}" do
before { get route }
expect_http_status(:ok)
expect_template(route)
end
end
%i[user_activity_history rfc_activity_history].each do |route|
describe "GET ##{route}" do
before { get route }
expect_http_status(:ok)
expect_template(:activity_history)
end
end
%i[show user_activity user_activity_history rfc_activity rfc_activity_history].each do |route|
describe "GET ##{route}.json" do
before { get route, format: :json }
expect_http_status(:ok)
expect_json
end
end
end