<commit_before>require "rails_helper"

describe "Static pages" do

  let(:user) { FactoryGirl.create(:user) }
  let(:admin) { FactoryGirl.create(:admin) }

  describe "before login" do
    describe "#home with nothing" do
      it "success" do
        get "/"
        expect(response).to be_success
      end
    end

    describe "#home" do
      it "success" do
        3.times { FactoryGirl.create :entry }
        3.times { FactoryGirl.create :question }
        3.times { FactoryGirl.create :video_news }
        get "/"
        expect(response).to be_success
      end
    end

    describe "#recent with nothing" do
      it "success" do
        get "/recent"
        expect(response).to be_success
      end
    end

    describe "#recent" do
      it "success" do
        3.times { FactoryGirl.create :entry }
        3.times { FactoryGirl.create :question }
        3.times { FactoryGirl.create :video_news }
        get "/recent"
        expect(response).to be_success
      end
    end

    describe "#report" do
      it "success" do
        get "/report"
        expect(response).to be_redirect
      end
    end

    describe "#about" do
      it "success" do
        get "/about"
        expect(response).to be_redirect
      end
    end
  end
  describe "after login" do
    before { sign_in(user) }
    after { sign_out }

    describe "#home has logout" do
      it "success" do
        get "/"
        expect(response.body).to match("登出")
        expect(response.body).to match("回報立委資訊")
      end
    end

    describe "#report" do
      it "success" do<commit_msg>static should success<commit_after>require "rails_helper"

describe "Static pages" do

  let(:user) { FactoryGirl.create(:user) }
  let(:admin) { FactoryGirl.create(:admin) }

  describe "before login" do
    describe "#home with nothing" do
      it "success" do
        get "/"
        expect(response).to be_success
      end
    end

    describe "#home" do
      it "success" do
        3.times { FactoryGirl.create :entry }
        3.times { FactoryGirl.create :question }
        3.times { FactoryGirl.create :video_news }
        get "/"
        expect(response).to be_success
      end
    end

    describe "#recent with nothing" do
      it "success" do
        get "/recent"
        expect(response).to be_success
      end
    end

    describe "#recent" do
      it "success" do
        3.times { FactoryGirl.create :entry }
        3.times { FactoryGirl.create :question }
        3.times { FactoryGirl.create :video_news }
        get "/recent"
        expect(response).to be_success
      end
    end

    describe "#report" do
      it "success" do
        get "/report"
        expect(response).to be_redirect
      end
    end

    describe "#about" do
      it "success" do
        get "/about"
        expect(response).to be_success
      end
    end
  end
  describe "after login" do
    before { sign_in(user) }
    after { sign_out }

    describe "#home has logout" do
      it "success" do
        get "/"
        expect(response.body).to match("登出")
        expect(response.body).to match("回報立委資訊")
      end
    end

    describe "#report" do
      it "success" do
{'fraction_non_alphanumeric': 0.10066058508965084, 'fraction_numerical': 0.0037747719408619063, 'mean_word_length': 1.9636533084808947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6710888', 'n_tokens_mistral': 977, 'n_tokens_neox': 938, 'n_words': 273}