Sha256: 21cc07e8c439385c2b98665bf0748f887cb04c68ecb81c46bd794c107db75ade

Contents?: true

Size: 1.64 KB

Versions: 34

Compression:

Stored size: 1.64 KB

Contents

require "rails_helper"
describe "the Languages", js: true do
  login_success

  it "Languages list" do
    admin_sign_in
    visit "#{cama_root_relative_path}/admin/settings/languages"
    expect(page).to have_content("Languages configuration")

    within '#languages_form' do
      page.execute_script('$("#languages_form [name=\'lang[]\']").filter("[value=\'fr\']").click()')
      page.execute_script('$("#languages_form [name=\'admin_language\']").filter("[value=\'es\']").click()')
      click_button "Submit"
    end

    expect(page).to have_css('.alert-success')
    within '#languages_form' do
      expect(page).to have_checked_field("Inglés")
      expect(page).to have_checked_field("Español")
      expect(page).to have_checked_field("Francés")
      page.execute_script('$("#languages_form [name=\'lang[]\']").filter("[value=\'es\']").click()')
      page.execute_script('$("#languages_form [name=\'admin_language\']").filter("[value=\'en\']").click()')
      click_button "Enviar"
    end
    page.execute_script('$("#languages_form [name=\'admin_language\']").filter("[value=\'es\']").click()')
    expect(page).to have_css('.alert-success')

    # Revert to single language and english backend
    within '#languages_form' do
      page.execute_script('$("#languages_form [name=\'lang[]\']").filter("[value=\'fr\']").prop("checked", false)')
      page.execute_script('$("#languages_form [name=\'lang[]\']").filter("[value=\'es\']").prop("checked", false)')
      page.execute_script('$("#languages_form [name=\'admin_language\']").filter("[value=\'en\']").click()')
      click_button "Submit"
    end
    expect(page).to have_css('.alert-success')
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
camaleon_cms-2.4.5.5 spec/features/languages_spec.rb
camaleon_cms-2.4.5.4 spec/features/languages_spec.rb
camaleon_cms-2.4.5.3 spec/features/languages_spec.rb
camaleon_cms-2.4.5.2 spec/features/languages_spec.rb
camaleon_cms-2.4.5.1 spec/features/languages_spec.rb
camaleon_cms-2.4.5 spec/features/languages_spec.rb
camaleon_cms-2.4.4.7 spec/features/languages_spec.rb
camaleon_cms-2.4.4.6 spec/features/languages_spec.rb
camaleon_cms-2.4.4.5 spec/features/languages_spec.rb
camaleon_cms-2.4.4.4 spec/features/languages_spec.rb
camaleon_cms-2.4.4.3 spec/features/languages_spec.rb
camaleon_cms-2.4.4.2 spec/features/languages_spec.rb
camaleon_cms-2.4.4.1 spec/features/languages_spec.rb
camaleon_cms-2.4.4 spec/features/languages_spec.rb
camaleon_cms-2.4.3.13 spec/features/languages_spec.rb
camaleon_cms-2.4.3.12 spec/features/languages_spec.rb
camaleon_cms-2.4.3.11 spec/features/languages_spec.rb
camaleon_cms-2.4.3.10 spec/features/languages_spec.rb
camaleon_cms-2.4.3.9 spec/features/languages_spec.rb
camaleon_cms-2.4.3.8 spec/features/languages_spec.rb