camaleon_cms 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of camaleon_cms might be problematic. Click here for more details.

Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -12
  3. data/app/assets/javascripts/camaleon_cms/admin/_custom_fields.js +1 -2
  4. data/app/assets/javascripts/camaleon_cms/admin/_data.js +1 -0
  5. data/app/assets/javascripts/camaleon_cms/admin/_post.js +1 -1
  6. data/app/assets/javascripts/camaleon_cms/admin/_posttype.js.coffee +21 -0
  7. data/app/assets/javascripts/camaleon_cms/admin/admin-manifest.js +2 -0
  8. data/app/assets/javascripts/camaleon_cms/admin/jquery_validate/fr.js +49 -0
  9. data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +11 -6
  10. data/app/controllers/camaleon_cms/admin/appearances/themes_controller.rb +6 -0
  11. data/app/controllers/camaleon_cms/admin/media_controller.rb +3 -0
  12. data/app/controllers/camaleon_cms/admin/users_controller.rb +3 -0
  13. data/app/controllers/camaleon_cms/camaleon_controller.rb +5 -0
  14. data/app/controllers/camaleon_cms/frontend_controller.rb +1 -1
  15. data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +1 -1
  16. data/app/decorators/camaleon_cms/site_decorator.rb +1 -1
  17. data/app/decorators/camaleon_cms/user_decorator.rb +4 -0
  18. data/app/helpers/camaleon_cms/admin/custom_fields_helper.rb +4 -4
  19. data/app/helpers/camaleon_cms/camaleon_helper.rb +5 -0
  20. data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +16 -16
  21. data/app/helpers/camaleon_cms/hooks_helper.rb +10 -4
  22. data/app/helpers/camaleon_cms/plugins_helper.rb +1 -1
  23. data/app/helpers/camaleon_cms/session_helper.rb +9 -4
  24. data/app/helpers/camaleon_cms/short_code_helper.rb +1 -1
  25. data/app/helpers/camaleon_cms/theme_helper.rb +1 -1
  26. data/app/helpers/camaleon_cms/uploader_helper.rb +10 -7
  27. data/app/mailers/camaleon_cms/html_mailer.rb +33 -17
  28. data/app/models/camaleon_cms/ability.rb +2 -2
  29. data/app/models/camaleon_cms/nav_menu.rb +2 -2
  30. data/app/models/camaleon_cms/nav_menu_item.rb +5 -3
  31. data/app/models/camaleon_cms/site.rb +5 -101
  32. data/app/models/camaleon_cms/user.rb +8 -144
  33. data/app/models/camaleon_cms/user_relationship.rb +1 -1
  34. data/app/models/camaleon_cms/user_role.rb +0 -2
  35. data/app/models/concerns/camaleon_cms/custom_fields_read.rb +14 -7
  36. data/app/models/concerns/camaleon_cms/metas.rb +5 -4
  37. data/app/models/concerns/camaleon_cms/site_default_settings.rb +87 -0
  38. data/app/models/concerns/camaleon_cms/user_methods.rb +142 -0
  39. data/app/uploaders/camaleon_cms_aws_uploader.rb +13 -4
  40. data/app/uploaders/camaleon_cms_uploader.rb +3 -1
  41. data/app/views/camaleon_cms/admin/appearances/nav_menus/_custom_menus.html.erb +11 -5
  42. data/app/views/camaleon_cms/admin/appearances/nav_menus/_external_menu.html.erb +8 -0
  43. data/app/views/camaleon_cms/admin/settings/_media_settings.html.erb +4 -0
  44. data/app/views/camaleon_cms/admin/settings/custom_fields/_get_items.html.erb +155 -154
  45. data/app/views/camaleon_cms/admin/settings/custom_fields/_render.html.erb +1 -1
  46. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkbox.html.erb +1 -1
  47. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_checkboxes.html.erb +1 -1
  48. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_posts.html.erb +2 -5
  49. data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +1 -1
  50. data/app/views/camaleon_cms/admin/settings/post_types/_form.html.erb +24 -16
  51. data/app/views/camaleon_cms/admin/users/form.html.erb +2 -2
  52. data/app/views/camaleon_cms/default_theme/single.html.erb +1 -1
  53. data/app/views/layouts/camaleon_cms/admin.html.erb +2 -2
  54. data/config/initializers/model_alias.rb +10 -3
  55. data/config/locales/camaleon_cms/admin/en.yml +10 -0
  56. data/config/locales/camaleon_cms/admin/fr.yml +663 -0
  57. data/config/locales/camaleon_cms/common.yml +66 -0
  58. data/config/routes/frontend.rb +1 -1
  59. data/config/system.json +2 -2
  60. data/db/migrate/20150611161134_post_table_into_utf8.rb +6 -5
  61. data/lib/camaleon_cms/engine.rb +3 -0
  62. data/lib/camaleon_cms/version.rb +1 -1
  63. data/lib/ext/string.rb +1 -54
  64. data/lib/plugin_routes.rb +5 -0
  65. data/spec/decorators/post_type_spec.rb +13 -0
  66. data/spec/dummy/README.rdoc +28 -0
  67. data/spec/dummy/Rakefile +6 -0
  68. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  69. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  70. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  71. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  72. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  73. data/spec/dummy/bin/bundle +3 -0
  74. data/spec/dummy/bin/rails +4 -0
  75. data/spec/dummy/bin/rake +4 -0
  76. data/spec/dummy/bin/setup +29 -0
  77. data/spec/dummy/config.ru +4 -0
  78. data/spec/dummy/config/application.rb +26 -0
  79. data/spec/dummy/config/boot.rb +5 -0
  80. data/spec/dummy/config/database.yml +25 -0
  81. data/spec/dummy/config/environment.rb +5 -0
  82. data/spec/dummy/config/environments/development.rb +41 -0
  83. data/spec/dummy/config/environments/production.rb +79 -0
  84. data/spec/dummy/config/environments/test.rb +42 -0
  85. data/spec/dummy/config/initializers/assets.rb +11 -0
  86. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  87. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  88. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  89. data/spec/dummy/config/initializers/inflections.rb +16 -0
  90. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  91. data/spec/dummy/config/initializers/session_store.rb +3 -0
  92. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  93. data/spec/dummy/config/locales/en.yml +23 -0
  94. data/spec/dummy/config/routes.rb +4 -0
  95. data/spec/dummy/config/secrets.yml +22 -0
  96. data/spec/dummy/db/development.sqlite3 +0 -0
  97. data/spec/dummy/db/schema.rb +186 -0
  98. data/spec/dummy/public/404.html +67 -0
  99. data/spec/dummy/public/422.html +67 -0
  100. data/spec/dummy/public/500.html +66 -0
  101. data/spec/dummy/public/favicon.ico +0 -0
  102. data/spec/features/categories_spec.rb +25 -0
  103. data/spec/features/comments_spec.rb +45 -0
  104. data/spec/features/contact_form_spec.rb +53 -0
  105. data/spec/features/content_groups_spec.rb +45 -0
  106. data/spec/features/custom_fields_spec.rb +47 -0
  107. data/spec/features/frontend/pages_spec.rb +5 -0
  108. data/spec/features/languages_spec.rb +27 -0
  109. data/spec/features/media_spec.rb +50 -0
  110. data/spec/features/menus_spec.rb +46 -0
  111. data/spec/features/pages_spec.rb +30 -0
  112. data/spec/features/plugins_spec.rb +29 -0
  113. data/spec/features/posts_spec.rb +36 -0
  114. data/spec/features/session_spec.rb +52 -0
  115. data/spec/features/settings_spec.rb +17 -0
  116. data/spec/features/shortcodes_spec.rb +11 -0
  117. data/spec/features/sites_spec.rb +45 -0
  118. data/spec/features/tags_spec.rb +25 -0
  119. data/spec/features/themes_spec.rb +18 -0
  120. data/spec/features/user_roles_spec.rb +60 -0
  121. data/spec/features/users_spec.rb +79 -0
  122. data/spec/features/widgets_spec.rb +50 -0
  123. data/spec/helpers/email_helper_spec.rb +16 -0
  124. data/spec/mailers/send_mail_spec.rb +37 -0
  125. data/spec/rails_helper.rb +1 -0
  126. data/spec/routing/post_type_routes_spec.rb +12 -0
  127. data/spec/spec_helper.rb +191 -0
  128. data/spec/support/common.rb +113 -0
  129. data/spec/support/wait_for_ajax.rb +36 -0
  130. metadata +326 -3
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,25 @@
1
+ require "rails_helper"
2
+ describe "the signin process", js: true do
3
+ login_success
4
+
5
+ it "create new category" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/post_type/2/categories"
8
+ within("#form-category") do
9
+ fill_in 'category_name', :with => 'Test cat'
10
+ fill_in 'category_slug', :with => 'test-cat'
11
+ end
12
+ click_button 'Submit'
13
+ expect(page).to have_css('.alert-success')
14
+ end
15
+
16
+ it "create edit category" do
17
+ admin_sign_in
18
+ visit "#{cama_root_relative_path}/admin/post_type/2/categories/6/edit"
19
+ within("#form-category") do
20
+ fill_in 'category_name', :with => 'Test cat update'
21
+ end
22
+ click_button 'Submit'
23
+ expect(page).to have_css('.alert-success')
24
+ end
25
+ end
@@ -0,0 +1,45 @@
1
+ require "rails_helper"
2
+ describe "the Comments", js: true do
3
+ login_success
4
+
5
+ it "Add Comment" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/posts/#{get_content_attr("post", "id", "last")}/comments"
8
+ page.execute_script('$("#comments_answer_list .panel-heading .btn-primary").click()')
9
+ wait_for_ajax
10
+ within 'form#new_comment' do
11
+ fill_in "comment_content", with: "Test comment"
12
+ find('button[type="submit"]').click
13
+ end
14
+ expect(page).to have_css('.alert-success')
15
+ end
16
+
17
+
18
+ it "list comments post" do
19
+ admin_sign_in
20
+ visit "#{cama_root_relative_path}/admin/comments"
21
+ within("#admin_content") do
22
+ # verify post presence
23
+ expect(page).to have_content("#{get_content_attr("post", "the_title", "last")}")
24
+
25
+ # access to list of comments
26
+ first('.btn-default').click
27
+ expect(page).to have_css('#comments_answer_list')
28
+
29
+ # approve || disapprove comment
30
+ (first('.approve') || first('.pending')).click
31
+ expect(page).to have_css('.alert-success')
32
+ end
33
+
34
+ # answer comment
35
+ within '#comments_answer_list' do
36
+ first('.reply').click
37
+ wait_for_ajax
38
+ end
39
+ within "#new_comment" do
40
+ fill_in "comment_content", with: "test answer comment"
41
+ find('button[type="submit"]').click
42
+ end
43
+ expect(page).to have_css('.alert-success')
44
+ end
45
+ end
@@ -0,0 +1,53 @@
1
+ require "rails_helper"
2
+ describe "the Contact Form", js: true do
3
+ login_success
4
+
5
+ it "create new contact form" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/plugins/cama_contact_form/admin_forms"
8
+ expect(page).to have_content('Contact Form')
9
+ within("#new_plugins_cama_contact_form_cama_contact_form") do
10
+ fill_in 'plugins_cama_contact_form_cama_contact_form_name', :with => 'Test form'
11
+ fill_in 'plugins_cama_contact_form_cama_contact_form_slug', :with => 'test-form'
12
+ first('button[type="submit"]').click
13
+ end
14
+ expect(page).to have_css('.alert-success')
15
+
16
+ # adding fields
17
+
18
+ within '#contact_form_editor' do
19
+ fill_in 'railscf_mail_to', :with => 'owenperedo@gmail.com'
20
+ fill_in 'railscf_mail_subject', :with => 'test subject'
21
+
22
+ within '#fields_available' do
23
+ all('.btn-default').each do |l|
24
+ l.click
25
+ end
26
+ end
27
+ page.execute_script('$("#contact_form_editor").find(".required").val("sample value")')
28
+ page.execute_script('$("#contact_form_editor").submit()')
29
+ end
30
+ end
31
+
32
+ it "check contact submitters" do
33
+ admin_sign_in
34
+ visit "#{cama_root_relative_path}/admin/plugins/cama_contact_form/admin_forms"
35
+ within("#admin_content") do
36
+ all("table .btn-info").last.click
37
+ end
38
+ expect(page).to have_css('#contact_form_answers')
39
+ end
40
+
41
+ # TODO test contact form in frontend
42
+
43
+ it "delete contact form" do
44
+ admin_sign_in
45
+ visit "#{cama_root_relative_path}/admin/plugins/cama_contact_form/admin_forms"
46
+ within '#admin_content' do
47
+ all("table .btn-danger").last.click
48
+ end
49
+ page.driver.browser.switch_to.alert.accept
50
+ expect(page).to have_css('.alert-success')
51
+ end
52
+
53
+ end
@@ -0,0 +1,45 @@
1
+ require "rails_helper"
2
+ describe "the Content Groups", js: true do
3
+ login_success
4
+
5
+ it "create new content group" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/settings/post_types"
8
+ expect(page).to have_content('Post')
9
+ expect(page).to have_content('Page')
10
+ within("#post_type_form") do
11
+ fill_in 'post_type_name', :with => 'Test cat'
12
+ fill_in 'post_type_slug', :with => 'test-content'
13
+ fill_in 'post_type_description', :with => 'test-content descri'
14
+ check("Manage Category")
15
+ click_button 'Submit'
16
+ end
17
+ expect(page).to have_css('.alert-success')
18
+ end
19
+
20
+ it "edit content type" do
21
+ admin_sign_in
22
+ visit "#{cama_root_relative_path}/admin/settings/post_types"
23
+ within '#admin_content' do
24
+ all("table .btn-default").last.click
25
+ end
26
+ within("#post_type_form") do
27
+ expect(page).to have_checked_field("Manage Category")
28
+ fill_in 'post_type_name', :with => 'Test cat updated'
29
+ fill_in 'post_type_slug', :with => 'test-content'
30
+ click_button 'Submit'
31
+ end
32
+ expect(page).to have_css('.alert-success')
33
+ end
34
+
35
+ it "delete content type" do
36
+ admin_sign_in
37
+ visit "#{cama_root_relative_path}/admin/settings/post_types"
38
+ within '#admin_content' do
39
+ all("table .btn-danger").last.click
40
+ end
41
+ page.driver.browser.switch_to.alert.accept
42
+ expect(page).to have_css('.alert-success')
43
+ end
44
+
45
+ end
@@ -0,0 +1,47 @@
1
+ require "rails_helper"
2
+ describe "the Custom Fields", js: true do
3
+ login_success
4
+
5
+ it "Custom fields list" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/settings/custom_fields"
8
+ within '#admin_content' do
9
+ click_link "Add Field Group"
10
+ end
11
+
12
+ # new custom field
13
+ within '#cama_custom_field_form' do
14
+ fill_in "custom_field_group_name", with: 'Test name'
15
+ fill_in "custom_field_group_description", with: 'Test name description'
16
+ find('#select_assign_group').find("option[value='PostType_Post,2']").click
17
+ all('#content-items-default a').each do |link|
18
+ link.click
19
+ end
20
+ wait_for_ajax
21
+ first('button[type="submit"]').click
22
+ end
23
+ expect(page).to have_css('.alert-success')
24
+
25
+ # update
26
+ within '#edit_custom_field_group' do
27
+ fill_in "custom_field_group_name", with: 'Test updated'
28
+ first('button[type="submit"]').click
29
+ end
30
+ within '#sortable-fields' do
31
+ expect(page).to have_content('Untitled Text Box')
32
+ end
33
+ expect(page).to have_css('.alert-success')
34
+ expect(page).to have_content('Test updated')
35
+ end
36
+
37
+ it "delete custom field" do
38
+ admin_sign_in
39
+ visit "#{cama_root_relative_path}/admin/settings/custom_fields"
40
+ within '#admin_content' do
41
+ all("table .btn-danger").last.click
42
+ end
43
+ page.driver.browser.switch_to.alert.accept
44
+ expect(page).to have_css('.alert-success')
45
+ end
46
+
47
+ end
@@ -0,0 +1,5 @@
1
+ # require 'rails_helper'
2
+ # describe "Post frontend", js: true do
3
+ # login_success
4
+ # pages_test
5
+ # end
@@ -0,0 +1,27 @@
1
+ require "rails_helper"
2
+ describe "the Languages", js: true do
3
+ login_success
4
+
5
+ it "Languages list" do
6
+ admin_sign_in
7
+ visit "#{cama_root_relative_path}/admin/settings/languages"
8
+ expect(page).to have_content("Languages configuration")
9
+
10
+ # create user role
11
+ within '#languages_form' do
12
+ page.execute_script('$("[name=\'lang[]\']").filter("[value=\'fr\']").click()')
13
+ page.execute_script('$("[name=\'admin_language\']").filter("[value=\'es\']").click()')
14
+ click_button "Submit"
15
+ end
16
+ expect(page).to have_css('.alert-success')
17
+ within '#languages_form' do
18
+ expect(page).to have_checked_field("Inglés")
19
+ expect(page).to have_checked_field("Español")
20
+ expect(page).to have_checked_field("Francés")
21
+ page.execute_script('$("[name=\'lang[]\']").filter("[value=\'es\']").click()')
22
+ page.execute_script('$("[name=\'admin_language\']").filter("[value=\'en\']").click()')
23
+ click_button "Enviar"
24
+ end
25
+ expect(page).to have_css('.alert-success')
26
+ end
27
+ end