Sha256: a59851f4ea88889d535b87640c04a586c02209baa4b70dc945382ffa1cf4711c

Contents?: true

Size: 1.21 KB

Versions: 40

Compression:

Stored size: 1.21 KB

Contents

require 'rails_helper'

RSpec.describe Cmor::Testimonials::ApplicationViewHelper, type: :view_helper do
  before(:each) do
    register_view_helper Markup::Rails::ApplicationViewHelper, as: :markup_helper
  end
  
  context 'testimonials present' do
    let(:testimonials) { create_list(:cmor_testimonials_testimonial, 3) }
    let(:category) { create(:cmor_testimonials_category, testimonials: testimonials) }
    let(:args) { [category.identifier, {}] }

    describe 'render_category' do
      it { expect(html).to have_css('div.cmor-testimonials-category') }
    end
  end

  context 'testimonials absent' do
    let(:testimonials) {[]}
    let(:category) { create(:cmor_testimonials_category, testimonials: testimonials) }
    let(:args) { [category.identifier, {}] }

    describe 'render_category' do
      it { expect(rendered).to eq(nil) }
    end
  end

  context 'when using a category as first argument' do
    let(:testimonials) { create_list(:cmor_testimonials_testimonial, 3) }
    let(:category) { create(:cmor_testimonials_category, testimonials: testimonials) }
    let(:args) { [category, {}] }

    describe 'render_category' do
      it { expect(html).to have_css('div.cmor-testimonials-category') }
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
cmor_testimonials-0.0.51.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.50.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.49.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.48.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.45.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.44.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.43.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.42.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.41.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.40.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.39.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.38.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.37.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.36.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.35.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.34.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.33.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.32.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.31.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.30.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb