implemented partial batch update for exercises

This commit is contained in:
Hauke Klement
2015-03-12 11:05:11 +01:00
parent f1de18141a
commit 6ee0b6bf81
9 changed files with 105 additions and 4 deletions

View File

@ -5,6 +5,20 @@ describe ExercisesController do
let(:user) { FactoryGirl.create(:admin) }
before(:each) { allow(controller).to receive(:current_user).and_return(user) }
describe 'PUT #batch_update' do
let(:attributes) { {public: true} }
let(:request) { proc { put :batch_update, exercises: {0 => attributes.merge(id: exercise.id)} } }
before(:each) { request.call }
it 'updates the exercises' do
expect_any_instance_of(Exercise).to receive(:update).with(attributes)
request.call
end
expect_json
expect_status(200)
end
describe 'POST #clone' do
let(:request) { proc { post :clone, id: exercise.id } }