File: apple_app_store_spec.rb

package info (click to toggle)
gitlab 17.6.5-19
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 629,368 kB
  • sloc: ruby: 1,915,304; javascript: 557,307; sql: 60,639; xml: 6,509; sh: 4,567; makefile: 1,239; python: 406
file content (24 lines) | stat: -rw-r--r-- 1,039 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Upload Dropzone Field', feature_category: :integrations do
  include_context 'project integration activation'

  it 'uploads the file data to the correct form fields and updates the messaging correctly', :js, :aggregate_failures do
    visit_project_integration('Apple App Store Connect')

    expect(page).to have_content('Drag your Private Key file here or click to upload.')
    expect(page).not_to have_content('auth_key.p8')

    find("input[name='service[dropzone_file_name]']",
      visible: false).set(Rails.root.join('spec/fixtures/auth_key.p8'))

    expect(page).to have_field("service[app_store_private_key]", type: :hidden,
      with: File.read(Rails.root.join('spec/fixtures/auth_key.p8')))
    expect(page).to have_field("service[app_store_private_key_file_name]", type: :hidden, with: 'auth_key.p8')

    expect(page).not_to have_content('Drag your Private Key file here or click to upload.')
    expect(page).to have_content('auth_key.p8')
  end
end