Sha256: 4cb5d68e70c3db2f4ae7f30f68b93e36828de253bb43af1c8aef809c40fb8628

Contents?: true

Size: 1.09 KB

Versions: 77

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe ApplicationHelper, organization_workspace: :test do
  helper ApplicationHelper
  helper LinksHelper

  describe '#link_to_exercise' do
    let(:exercise) { lesson.exercises.third }
    let(:lesson) {
      create(:lesson, name: 'bar', exercises: [
          create(:exercise, name: 'foo2', id: 10),
          create(:exercise, name: 'foo2', id: 20),
          create(:exercise, name: 'foo3', id: 30)
      ]) }
    let!(:chapter) { create(:chapter, name: 'C1', lessons: [lesson]) }

    before { reindex_current_organization! }

    it { expect(link_to_path_element(exercise, mode: :plain)).to eq '<a href="/exercises/30-c1-bar-foo3">foo3</a>' }
    it { expect(link_to_path_element(exercise, mode: :friendly)).to eq '<a href="/exercises/30-c1-bar-foo3">C1: bar - foo3</a>' }
    it { expect(link_to_path_element(exercise)).to eq '<a href="/exercises/30-c1-bar-foo3">3. foo3</a>' }
  end

  describe '#link_to_guide' do
    let(:lesson) { create(:lesson, id: 1, name: 'foo') }
    it { expect(link_to_path_element(lesson)).to start_with '<a href="/lessons/1-foo">foo' }
  end

end

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
mumuki-laboratory-9.0.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.6.1 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.6.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.5.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.4.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.3.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.2.1 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.2.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.1.3 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.1.2 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.1.1 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.1.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.12.3 spec/helpers/application_helper_spec.rb
mumuki-laboratory-8.0.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.12.1 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.12.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.11.1 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.11.0 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.10.5 spec/helpers/application_helper_spec.rb
mumuki-laboratory-7.10.4 spec/helpers/application_helper_spec.rb