Sha256: e170a2af5c317f0d1a62862e5af2f784d82e689c38b6384a5775f39db842d71d

Contents?: true

Size: 706 Bytes

Versions: 12

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'

describe ExerciseConfirmationsController, organization_workspace: :test do
  let(:user) { create(:user) }
  let(:reading) { create(:reading, guide: create(:indexed_guide)) }

  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).to json_like(guide_finished_by_solution: true, class_for_progress_list_item: 'progress-list-item text-center success active') }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mumuki-laboratory-7.6.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.6.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.6.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.5.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.5.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.5.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.4.2 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.4.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.4.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.3.1 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.3.0 spec/controllers/confirmations_controller_spec.rb
mumuki-laboratory-7.2.0 spec/controllers/confirmations_controller_spec.rb