Fix rubocop offenses
This commit is contained in:
@ -130,6 +130,7 @@ describe Lti do
|
|||||||
|
|
||||||
context 'when grading is supported' do
|
context 'when grading is supported' do
|
||||||
let(:response) { double }
|
let(:response) { double }
|
||||||
|
let(:send_score) { controller.send(:send_score, submission) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow_any_instance_of(IMS::LTI::ToolProvider).to receive(:outcome_service?).and_return(true)
|
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(:post_response).and_return(response)
|
||||||
allow(response).to receive(:body).at_least(:once).and_return('')
|
allow(response).to receive(:body).at_least(:once).and_return('')
|
||||||
allow(response).to receive(:code_major).at_least(:once).and_return('success')
|
allow(response).to receive(:code_major).at_least(:once).and_return('success')
|
||||||
|
allow(submission).to receive(:normalized_score).and_return score
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'sends the score' do
|
it 'sends the score' do
|
||||||
allow(submission).to receive(:normalized_score).and_return score
|
expect_any_instance_of(IMS::LTI::ToolProvider).to receive(:post_replace_result!).with(score)
|
||||||
controller.send(:send_score, submission)
|
send_score
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns code, message, and status' do
|
it 'returns code, message, and status' do
|
||||||
allow(submission).to receive(:normalized_score).and_return score
|
expect(send_score[:code]).to eq(response.response_code)
|
||||||
result = controller.send(:send_score, submission)
|
expect(send_score[:message]).to eq(response.body)
|
||||||
expect(result[:code]).to eq(response.response_code)
|
expect(send_score[:status]).to eq(response.code_major)
|
||||||
expect(result[:message]).to eq(response.body)
|
|
||||||
expect(result[:status]).to eq(response.code_major)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -29,6 +29,6 @@ describe 'Request_for_Comments' do
|
|||||||
|
|
||||||
it 'contains a filter for study group in the view' do
|
it 'contains a filter for study group in the view' do
|
||||||
visit(request_for_comments_path)
|
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
|
||||||
end
|
end
|
||||||
|
@ -43,6 +43,7 @@ describe TestingFrameworkAdapter do
|
|||||||
describe '#test_outcome' do
|
describe '#test_outcome' do
|
||||||
it 'calls the framework-specific implementation' do
|
it 'calls the framework-specific implementation' do
|
||||||
allow(adapter).to receive(:parse_output).and_return(count: count, failed: failed, passed: passed)
|
allow(adapter).to receive(:parse_output).and_return(count: count, failed: failed, passed: passed)
|
||||||
|
expect(adapter).to receive(:parse_output)
|
||||||
adapter.test_outcome('')
|
adapter.test_outcome('')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user