fixing tests p3

This commit is contained in:
Tom Staubitz
2017-01-13 09:56:36 +01:00
parent 4af24d4317
commit 6bf73757ae
2 changed files with 8 additions and 2 deletions

View File

@ -230,11 +230,14 @@ describe ExercisesController do
describe 'POST #submit' do
let(:output) { {} }
let(:request) { post :submit, format: :json, id: exercise.id, submission: {cause: 'submit', exercise_id: exercise.id} }
let!(:external_user) { FactoryGirl.create(:external_user) }
let!(:lti_parameter) { FactoryGirl.create(:lti_parameter) }
before(:each) do
allow_any_instance_of(Submission).to receive(:normalized_score).and_return(1)
expect(controller).to receive(:collect_test_results).and_return([{score: 1, weight: 1}])
expect(controller).to receive(:score_submission).and_call_original
controller.session[:consumer_id] = external_user.consumer_id
end
context 'when LTI outcomes are supported' do