Sha256: 88a3f7ba8602016a5e3f7c9000e4e815388479905d2b55a2604766fa4afbd7c0

Contents?: true

Size: 571 Bytes

Versions: 13

Compression:

Stored size: 571 Bytes

Contents

require 'spec_helper'

describe ExerciseConfirmationsController do
  let(:user) { create(:user) }
  let(:reading) { create(:reading) }

  context 'when not authenticated' do
    before { post :create, params: { exercise_id: reading.id } }

    it { expect(response.status).to eq 403 }
  end

  context 'when authenticated' do
    before { set_current_user! user }
    before { post :create, params: { exercise_id: reading.id } }

    it { expect(response.status).to eq 200 }
    it { expect(response.body.parse_json).to json_like(status: :passed, result: '') }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
mumuki-laboratory-5.0.12 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.11 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.10 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.9 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.8 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.7 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.6 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.5 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.4 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.3 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.0.0 spec/controllers/confirmations_controller_spec.rb