<commit_before>require 'test_helper'

# rubocop:disable Metrics/BlockLength
describe FeedsController do
  let(:user) { users :test1 }
  let(:feed) { user.subscriptions.first.feed }

  before do
    login user
  end

  it 'should get index' do
    get :index
    assert_response :success
    assert_not_nil assigns(:feeds)
  end

  it 'should show feed' do
    get :show, params: { id: feed }
    assert_not_nil assigns(:feed)
    assert_response :success
  end

  describe 'Internal API' do
    it 'GET /i/feeds.json' do
      get :index, format: 'json'
      assert_response :success
      res = JSON.parse(response.body)
      res.must_be_instance_of Hash
      res.count.must_equal 1
    end

    it 'GET /i/feeds/:id.json' do
      get :show, params: { id: feed }, format: 'json'
      assert_response :success
      res = JSON.parse(response.body)
      res['url'].must_equal feed.url
      res['articles'].must_be_instance_of Array
    end

    it 'PATCH /i/feeds/:id/mark_as_read.json' do
      patch :mark_feed_as_read, params: { id: feed }, format: 'json'
      assert_response :success
    end

    it 'PATCH /i/feeds/mark_all_as_read.json' do
      patch :mark_all_as_read, format: 'json'
      assert_response :success
    end
  end
end<commit_msg>Remove obsolete assertion<commit_after>require 'test_helper'

# rubocop:disable Metrics/BlockLength
describe FeedsController do
  let(:user) { users :test1 }
  let(:feed) { user.subscriptions.first.feed }

  before do
    login user
  end

  it 'should get index' do
    get :index
    assert_response :success
    assert_not_nil assigns(:feeds)
  end

  it 'should show feed' do
    get :show, params: { id: feed }
    assert_not_nil assigns(:feed)
    assert_response :success
  end

  describe 'Internal API' do
    it 'GET /i/feeds.json' do
      get :index, format: 'json'
      assert_response :success
      res = JSON.parse(response.body)
      res.must_be_instance_of Hash
    end

    it 'GET /i/feeds/:id.json' do
      get :show, params: { id: feed }, format: 'json'
      assert_response :success
      res = JSON.parse(response.body)
      res['url'].must_equal feed.url
      res['articles'].must_be_instance_of Array
    end

    it 'PATCH /i/feeds/:id/mark_as_read.json' do
      patch :mark_feed_as_read, params: { id: feed }, format: 'json'
      assert_response :success
    end

    it 'PATCH /i/feeds/mark_all_as_read.json' do
      patch :mark_all_as_read, format: 'json'
      assert_response :success
    end
  end
end
{'fraction_non_alphanumeric': 0.10067918497802637, 'fraction_numerical': 0.0011985617259288853, 'mean_word_length': 2.882170542635659, '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': '7308602', 'n_tokens_mistral': 862, 'n_tokens_neox': 840, 'n_words': 223}