2022-04-04 11:22:00 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
RSpec.describe 'initRedirectListboxBehavior', '(JavaScript fixtures)', type: :helper do
|
|
|
|
include JavaScriptFixturesHelpers
|
|
|
|
include ListboxHelper
|
|
|
|
|
|
|
|
let(:response) { @tag }
|
|
|
|
|
|
|
|
it 'listbox/redirect_listbox.html' do
|
|
|
|
items = [{
|
|
|
|
value: 'foo',
|
|
|
|
text: 'Foo',
|
|
|
|
href: '/foo',
|
|
|
|
arbitrary_key: 'foo xyz'
|
|
|
|
}, {
|
|
|
|
value: 'bar',
|
|
|
|
text: 'Bar',
|
|
|
|
href: '/bar',
|
|
|
|
arbitrary_key: 'bar xyz'
|
|
|
|
}, {
|
|
|
|
value: 'qux',
|
|
|
|
text: 'Qux',
|
|
|
|
href: '/qux',
|
|
|
|
arbitrary_key: 'qux xyz'
|
|
|
|
}]
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
@tag = helper.gl_redirect_listbox_tag(items, 'bar',
|
|
|
|
class: %w[test-class-1 test-class-2],
|
|
|
|
data: { placement: 'right' }
|
|
|
|
)
|
2022-04-04 11:22:00 +05:30
|
|
|
end
|
|
|
|
end
|