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