Sha256: eecb5b2078c582658c442d8ce6f51a6f8baec7082d3595e0e66fde3e66531702

Contents?: true

Size: 737 Bytes

Versions: 5

Compression:

Stored size: 737 Bytes

Contents

RSpec.describe Spree::FaqsController, type: :controller do

  let!(:question_category) { create(:question_category) }
  let!(:question) { create(:question, question_category: question_category) }

  before { allow(controller).to receive(:try_spree_current_user) }

  context '#index' do
    specify do
      categories = [
        question_category,
        create(:question_category),
        create(:question_category)
      ]

      spree_get :index
      expect(assigns(:categories)).to eq categories
      expect(response).to be_success
    end
  end

  context '#default_title' do
    it 'returns default title' do
      expect(subject.default_title).to eq Spree.t(:frequently_asked_questions, scope: :spree_faq)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree-faq-2.4.0 spec/controllers/faqs_controller_spec.rb
spree-faq-2.3.0 spec/controllers/faqs_controller_spec.rb
spree-faq-2.2.1 spec/controllers/faqs_controller_spec.rb
spree-faq-2.1.1 spec/controllers/faqs_controller_spec.rb
spree-faq-2.0.1 spec/controllers/faqs_controller_spec.rb