Sha256: dae221dcd98a8f0e59ea9a0c229acf05445558d9319054fd7a3180946f1426ce

Contents?: true

Size: 1.14 KB

Versions: 14

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe BreadcrumbsHelper, organization_workspace: :test do

  helper BreadcrumbsHelper
  helper LinksHelper

  let(:breadcrumb) { breadcrumbs(exercise) }

  context 'exercise in complement' do
    let!(:complement) { create(:complement, name: 'my guide', exercises: [
        create(:exercise, name: 'my exercise')
    ]) }
    let(:exercise) { complement.exercises.first }

    before { reindex_current_organization! }

    it { expect(breadcrumb).to include('my exercise') }
    it { expect(breadcrumb).to include('my guide') }
    it { expect(breadcrumb).to be_html_safe }
  end

  context 'exercise in chapter' do
    let!(:chapter) { create(:chapter, name: 'my chapter', lessons: [
        create(:lesson, name: 'my lesson', exercises: [
            create(:exercise, name: 'my exercise')
        ])
    ]) }
    let(:exercise) { chapter.first_lesson.exercises.first }

    before { reindex_current_organization! }

    it { expect(breadcrumb).to include('my exercise') }
    it { expect(breadcrumb).to include('my lesson') }
    it { expect(breadcrumb).to include('my chapter') }
    it { expect(breadcrumb).to be_html_safe }
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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