debian-mirror-gitlab/spec/lib/gitlab/git/blame_mode_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.4 KiB
Ruby
Raw Normal View History

2023-06-20 00:43:36 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Git::BlameMode, feature_category: :source_code_management do
subject(:blame_mode) { described_class.new(project, params) }
let_it_be(:project) { build(:project) }
let(:params) { {} }
describe '#streaming?' do
subject { blame_mode.streaming? }
it { is_expected.to be_falsey }
context 'when streaming param is provided' do
let(:params) { { streaming: true } }
it { is_expected.to be_truthy }
end
end
describe '#pagination?' do
subject { blame_mode.pagination? }
it { is_expected.to be_truthy }
context 'when `streaming` params is enabled' do
let(:params) { { streaming: true } }
it { is_expected.to be_falsey }
end
context 'when `no_pagination` param is provided' do
let(:params) { { no_pagination: true } }
it { is_expected.to be_falsey }
end
context 'when `blame_page_pagination` is disabled' do
before do
stub_feature_flags(blame_page_pagination: false)
end
it { is_expected.to be_falsey }
end
end
describe '#full?' do
subject { blame_mode.full? }
it { is_expected.to be_falsey }
context 'when `blame_page_pagination` is disabled' do
before do
stub_feature_flags(blame_page_pagination: false)
end
it { is_expected.to be_truthy }
end
end
end