2023-10-13 19:42:59 +11:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 15:12:25 +10:00
|
|
|
RSpec.describe 'Admin::Trends::Links::PreviewCardProviders' do
|
2023-10-13 19:42:59 +11:00
|
|
|
let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in current_user
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'Performing batch updates' do
|
|
|
|
before do
|
|
|
|
visit admin_trends_links_preview_card_providers_path
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'without selecting any records' do
|
|
|
|
it 'displays a notice about selection' do
|
2024-01-04 20:20:32 +11:00
|
|
|
click_on button_for_allow
|
2023-10-13 19:42:59 +11:00
|
|
|
|
|
|
|
expect(page).to have_content(selection_error_text)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def button_for_allow
|
|
|
|
I18n.t('admin.trends.allow')
|
|
|
|
end
|
|
|
|
|
|
|
|
def selection_error_text
|
|
|
|
I18n.t('admin.trends.links.publishers.no_publisher_selected')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|