Sha256: d893f0f8a844a61863649611750534b95f956e6b6237ab299aecddbc10cbb4e1

Contents?: true

Size: 751 Bytes

Versions: 5

Compression:

Stored size: 751 Bytes

Contents

RSpec.feature 'FAQ', :js do

  given!(:user) { create(:user) }
  given!(:question_category) { create(:question_category, name: 'Shopping') }
  given!(:question) do
    create(
      :question,
      question_category: question_category,
      question: 'Do you sell stuff?',
      answer: 'Think so..'
    )
  end

  background do
    visit spree.faq_path
  end

  scenario 'have all elements' do
    expect(page).to have_text Spree.t(:frequently_asked_questions, scope: :spree_faq)
    expect(page).to have_text 'Shopping'
    expect(page).to have_text 'Do you sell stuff?'
  end

  context 'when click on question' do
    scenario 'show answer' do
      click_link 'Do you sell stuff?'
      expect(page).to have_text 'Think so..'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree-faq-2.4.0 spec/features/faq_spec.rb
spree-faq-2.3.0 spec/features/faq_spec.rb
spree-faq-2.2.1 spec/features/faq_spec.rb
spree-faq-2.1.1 spec/features/faq_spec.rb
spree-faq-2.0.1 spec/features/faq_spec.rb