<commit_before>require 'spec_helper'

describe PagesController, "GET to #opensearch", type: :controller do
  context 'when asked for XML file' do
    render_views

    before(:each) do
      get :opensearch, format: 'xml'
    end

    it { should respond_with(:success) }
    it 'renders OpenSearch file successfully' do
      expect(response.body).to include 'Tariff'
    end
  end

  context 'when asked with no format' do
    pending do
      before {
        get :opensearch
      }

      it 'returns HTTP 406 (not supported) status' do
        expect(response.status).to eq 406
      end
    end

    it "raises ActionController::UnknownFormat as per rails 4" do
      expect {
        get :opensearch
      }.to raise_error(ActionController::UnknownFormat)
    end
  end

  context 'with unsupported format' do
    pending do
      before {
        get :opensearch, format: :json
      }

      it 'returns HTTP 406 (not supported) status' do
        expect(response.status).to eq 406
      end
    end

    it "raises ActionController::UnknownFormat as per rails 4" do
      expect {
        get :opensearch, format: :json
      }.to raise_error(ActionController::UnknownFormat)
    end
  end
end<commit_msg>Remove pending specs as Rails 4 raises ActionController::UnknownFormat<commit_after>require 'spec_helper'

describe PagesController, "GET to #opensearch", type: :controller do
  context 'when asked for XML file' do
    render_views

    before(:each) do
      get :opensearch, format: 'xml'
    end

    it { should respond_with(:success) }
    it 'renders OpenSearch file successfully' do
      expect(response.body).to include 'Tariff'
    end
  end

  context 'when asked with no format' do
    it "raises ActionController::UnknownFormat as per rails 4" do
      expect {
        get :opensearch
      }.to raise_error(ActionController::UnknownFormat)
    end
  end

  context 'with unsupported format' do
    it "raises ActionController::UnknownFormat as per rails 4" do
      expect {
        get :opensearch, format: :json
      }.to raise_error(ActionController::UnknownFormat)
    end
  end
end
{'fraction_non_alphanumeric': 0.07507082152974505, 'fraction_numerical': 0.008026440037771483, 'mean_word_length': 2.824909747292419, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2754012', 'n_tokens_mistral': 640, 'n_tokens_neox': 594, 'n_words': 212}