require 'rails_helper'

describe "Static pages" do
  subject { page }
  before :all do
    StaticPageText.create description: 'Главная страница'   , text: '', private_id: 1
    StaticPageText.create description: 'О нас'              , text: '', private_id: 2
    StaticPageText.create description: 'Вопросы ответы'     , text: '', private_id: 3
    StaticPageText.create description: 'Контакты'           , text: '', private_id: 4
    StaticPageText.create description: 'Зарезервировано 1'  , text: '', private_id: 5
    StaticPageText.create description: 'Зарезервировано 2'  , text: '', private_id: 6
    StaticPageText.create description: 'Зарезервировано 3'  , text: '', private_id: 7
    StaticPageText.create description: 'Зарезервировано 4'  , text: '', private_id: 8
    StaticPageText.create description: 'Зарезервировано 5'  , text: '', private_id: 9
  end

  describe "Index page" do
    before { visit root_path }
    it { is_expected.to have_content('Танол') }

    it "should have the content Танол" do
      visit '/'
      expect(page).to have_content('Танол')
    end
  end

  describe "About page" do
    before { visit about_path }
    it { is_expected.to have_content('Танол') }
  end

  describe "Contacts page" do
    before { visit contacts_path }
    it { is_expected.to have_content('Танол') }
  end

    describe "QA page" do
    before { visit question_answer_path }
    it { is_expected.to have_content('Танол') }
  end

end
