Sha256: 3d97d914b3d801bd7d81f538ae5531b9d6ed6f74f786d863c6082562c4a6a231

Contents?: true

Size: 724 Bytes

Versions: 45

Compression:

Stored size: 724 Bytes

Contents

require 'spec_helper'

describe Playground do
  let(:user) { create(:user) }

  describe '#create' do
    context 'when language is queriable and exercise is playable' do
      let(:language) { create(:language, queriable: true) }
      let(:guide) { create(:guide) }
      let(:exercise) { build(:playground, language: language, layout: :input_bottom, guide: guide, number: 1) }

      it { expect(exercise.save).to be true }
    end

    context 'when language is not queriable and exercise is playable' do
      let(:language) { create(:language, queriable: false) }
      let(:exercise) { build(:playground, language: language, layout: :input_bottom) }

      it { expect(exercise.save).to be false }
    end
  end

end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
mumuki-laboratory-5.6.2 spec/models/playground_spec.rb
mumuki-laboratory-5.6.1 spec/models/playground_spec.rb
mumuki-laboratory-5.6.0 spec/models/playground_spec.rb
mumuki-laboratory-5.5.0 spec/models/playground_spec.rb
mumuki-laboratory-5.4.0 spec/models/playground_spec.rb