Sha256: 627a42690244bd42bae93a6790d8e241996bf0b2179b7aa3ee931331e1c7ebaf

Contents?: true

Size: 1.37 KB

Versions: 29

Compression:

Stored size: 1.37 KB

Contents

require "rails_helper"
describe "the Custom Fields", js: true do
  init_site

  it "Custom fields list" do
    admin_sign_in
    visit "#{cama_root_relative_path}/admin/settings/custom_fields"
    within '#admin_content' do
      click_link "Add Field Group"
    end

    # new custom field
    within '#cama_custom_field_form' do
      fill_in "custom_field_group_name", with: 'Test name'
      fill_in "custom_field_group_description", with: 'Test name description'
      page.execute_script('$("#select_assign_group").val("PostType_Post,2")')

      wait 2
      all('#content-items-default a').each do |link|
        link.click
      end
      wait_for_ajax
      first('button[type="submit"]').click
    end
    expect(page).to have_css('.alert-success')

    # update
    within '#edit_custom_field_group' do
      fill_in "custom_field_group_name", with: 'Test updated'
      first('button[type="submit"]').click
    end
    within '#sortable-fields' do
      expect(page).to have_content('Untitled Text Box')
    end
    expect(page).to have_css('.alert-success')
    expect(page).to have_content('Test updated')
  end

  it "delete custom field" do
    admin_sign_in
    visit "#{cama_root_relative_path}/admin/settings/custom_fields"
    within '#admin_content' do
      all("table .btn-danger").last.click
    end
    confirm_dialog
    expect(page).to have_css('.alert-success')
  end

end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
camaleon_cms-2.6.4 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.6.3 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.6.2 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.6.1 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.6.0.1 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.6.0 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.5.3.1 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.5.3 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.5.2 spec/features/admin/custom_fields_spec.rb
camaleon_cms_rails6-2.5.0 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.5.1 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.5.0 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.9 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.8 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.7 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.6 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.5 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.4 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.3 spec/features/admin/custom_fields_spec.rb
camaleon_cms-2.4.6.2 spec/features/admin/custom_fields_spec.rb