Apply manual rubocop fixes
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
require 'rails_helper'
|
||||
|
||||
describe 'Authorization' do
|
||||
context 'as an admin' do
|
||||
context 'when being an admin' do
|
||||
let(:user) { FactoryBot.create(:admin) }
|
||||
|
||||
before { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
@ -13,7 +13,7 @@ describe 'Authorization' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'as an external user' do
|
||||
context 'with being an external user' do
|
||||
let(:user) { FactoryBot.create(:external_user) }
|
||||
|
||||
before { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
@ -23,7 +23,7 @@ describe 'Authorization' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'as a teacher' do
|
||||
context 'with being a teacher' do
|
||||
let(:user) { FactoryBot.create(:teacher) }
|
||||
|
||||
before { allow_any_instance_of(ApplicationController).to receive(:current_user).and_return(user) }
|
||||
|
@ -29,7 +29,7 @@ describe 'Editor', js: true do
|
||||
fill_in('email', with: user.email)
|
||||
fill_in('password', with: FactoryBot.attributes_for(:teacher)[:password])
|
||||
click_button(I18n.t('sessions.new.link'))
|
||||
expect_any_instance_of(LtiHelper).to receive(:lti_outcome_service?).and_return(true)
|
||||
allow_any_instance_of(LtiHelper).to receive(:lti_outcome_service?).and_return(true)
|
||||
visit(implement_exercise_path(exercise))
|
||||
end
|
||||
|
||||
|
@ -7,8 +7,9 @@ describe Prometheus::Controller do
|
||||
let(:prometheus_config) { {prometheus_exporter: {enabled: true}} }
|
||||
|
||||
def stub_metrics
|
||||
metrics = %i[@instance_count @rfc_count @rfc_commented_count]
|
||||
%i[increment decrement observe].each do |method|
|
||||
%i[@instance_count @rfc_count @rfc_commented_count].each do |metric|
|
||||
metrics.each do |metric|
|
||||
allow(described_class.instance_variable_get(metric)).to receive(method)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user