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.29.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.28.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.27.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.26.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.25.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.24.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.22.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.21.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.20.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.19.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.18.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.17.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.16.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.15.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.14.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.13.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.12.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.11.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.10.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb
cmor_testimonials-0.0.9.pre spec/view_helpers/cmor/testimonials/application_view_helper_spec.rb