Sha256: 41fa3d6aebf73e729eb36227df4e02f76512c872d2c3946f5e56ac4fc20b3744

Contents?: true

Size: 995 Bytes

Versions: 15

Compression:

Stored size: 995 Bytes

Contents

require 'spec_helper'

describe Guide, organization_workspace: :test do
  let!(:extra_user) { create(:user, first_name: 'Ignatius', last_name: 'Reilly') }
  let(:guide) { create(:guide) }

  describe '#clear_progress!' do
    let(:an_exercise) { create(:exercise) }
    let(:another_exercise) { create(:exercise) }

    before do
      guide.exercises = [an_exercise]
      an_exercise.submit_solution! extra_user
      another_exercise.submit_solution! extra_user
      guide.clear_progress!(extra_user)
    end

    it 'destroys the guides assignments for the given user' do
      expect(an_exercise.assignment_for(extra_user)).to be_nil
    end

    it 'does not destroy other guides assignments' do
      expect(another_exercise.assignment_for(extra_user)).to be_truthy
    end
  end

  describe '#submission_contents_for' do
    before do
      guide.exercises = [create(:exercise, language: guide.language), create(:exercise, language: guide.language)]
      guide.save!
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
mumuki-laboratory-5.8.3 spec/models/guide_spec.rb
mumuki-laboratory-5.8.1 spec/models/guide_spec.rb
mumuki-laboratory-5.8.0 spec/models/guide_spec.rb
mumuki-laboratory-5.7.0 spec/models/guide_spec.rb
mumuki-laboratory-5.6.3 spec/models/guide_spec.rb
mumuki-laboratory-5.6.2 spec/models/guide_spec.rb
mumuki-laboratory-5.6.1 spec/models/guide_spec.rb
mumuki-laboratory-5.6.0 spec/models/guide_spec.rb
mumuki-laboratory-5.5.0 spec/models/guide_spec.rb
mumuki-laboratory-5.4.0 spec/models/guide_spec.rb
mumuki-laboratory-5.3.0 spec/models/guide_spec.rb
mumuki-laboratory-5.2.1 spec/models/guide_spec.rb
mumuki-laboratory-5.2.0 spec/models/guide_spec.rb
mumuki-laboratory-5.1.1 spec/models/guide_spec.rb
mumuki-laboratory-5.1.0 spec/models/guide_spec.rb