Sha256: f0e3ee1b8e11fd4f9b0591b7ca5e05cd916c7b714c2d5eac44d650b3c20ce94e

Contents?: true

Size: 1.11 KB

Versions: 13

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe BreadcrumbsHelper 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

13 entries across 13 versions & 1 rubygems

Version Path
mumuki-laboratory-5.0.12 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.11 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.10 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.9 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.8 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.7 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.6 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.5 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.4 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.3 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.2 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.1 spec/helpers/with_breadcrumbs_spec.rb
mumuki-laboratory-5.0.0 spec/helpers/with_breadcrumbs_spec.rb