Fix rubocop offenses

This commit is contained in:
Sebastian Serth
2022-09-14 00:31:47 +02:00
parent 9183c0634f
commit 006c794f54
3 changed files with 9 additions and 8 deletions

View File

@ -130,6 +130,7 @@ describe Lti do
context 'when grading is supported' do
let(:response) { double }
let(:send_score) { controller.send(:send_score, submission) }
before do
allow_any_instance_of(IMS::LTI::ToolProvider).to receive(:outcome_service?).and_return(true)
@ -138,19 +139,18 @@ describe Lti do
allow(response).to receive(:post_response).and_return(response)
allow(response).to receive(:body).at_least(:once).and_return('')
allow(response).to receive(:code_major).at_least(:once).and_return('success')
allow(submission).to receive(:normalized_score).and_return score
end
it 'sends the score' do
allow(submission).to receive(:normalized_score).and_return score
controller.send(:send_score, submission)
expect_any_instance_of(IMS::LTI::ToolProvider).to receive(:post_replace_result!).with(score)
send_score
end
it 'returns code, message, and status' do
allow(submission).to receive(:normalized_score).and_return score
result = controller.send(:send_score, submission)
expect(result[:code]).to eq(response.response_code)
expect(result[:message]).to eq(response.body)
expect(result[:status]).to eq(response.code_major)
expect(send_score[:code]).to eq(response.response_code)
expect(send_score[:message]).to eq(response.body)
expect(send_score[:status]).to eq(response.code_major)
end
end
end

View File

@ -29,6 +29,6 @@ describe 'Request_for_Comments' do
it 'contains a filter for study group in the view' do
visit(request_for_comments_path)
expect(page.find('#q_submission_study_group_id_in')).not_to be_nil
expect(page.find_by_id('q_submission_study_group_id_in')).not_to be_nil # rubocop:disable Rails/DynamicFindBy
end
end

View File

@ -43,6 +43,7 @@ describe TestingFrameworkAdapter do
describe '#test_outcome' do
it 'calls the framework-specific implementation' do
allow(adapter).to receive(:parse_output).and_return(count: count, failed: failed, passed: passed)
expect(adapter).to receive(:parse_output)
adapter.test_outcome('')
end
end