Sha256: dcbeda23f699ae4cbd8fe415675c2e3e1051fd28c84f7165ee77bf76250c2fdb

Contents?: true

Size: 602 Bytes

Versions: 25

Compression:

Stored size: 602 Bytes

Contents

require 'spec_helper'

describe ExerciseConfirmationsController, organization_workspace: :test 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

25 entries across 25 versions & 1 rubygems

Version Path
mumuki-laboratory-5.12.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.12.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.11.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.10.4 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.10.3 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.10.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.10.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.10.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.9.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.9.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.8.3 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.8.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.8.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.7.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.6.3 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.6.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.6.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.6.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.5.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-5.4.0 spec/controllers/confirmations_controller_spec.rb