camaleon_cms 2.4.5.5 → 2.4.5.7
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.
- checksums.yaml +4 -4
- data/app/apps/themes/default/views/partials/_comments.html.erb +36 -21
- data/app/apps/themes/default/views/post.html.erb +1 -1
- data/app/assets/javascripts/camaleon_cms/admin/uploader/_media_manager.js.coffee +4 -4
- data/app/controllers/camaleon_cms/admin/categories_controller.rb +3 -0
- data/app/controllers/camaleon_cms/admin/media_controller.rb +9 -6
- data/app/controllers/camaleon_cms/admin/sessions_controller.rb +1 -1
- data/app/controllers/camaleon_cms/admin/settings/post_types_controller.rb +2 -0
- data/app/controllers/concerns/camaleon_cms/frontend_concern.rb +17 -13
- data/app/decorators/camaleon_cms/post_decorator.rb +0 -1
- data/app/helpers/camaleon_cms/captcha_helper.rb +1 -1
- data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +1 -0
- data/app/helpers/camaleon_cms/hooks_helper.rb +6 -1
- data/app/helpers/camaleon_cms/site_helper.rb +1 -1
- data/app/helpers/camaleon_cms/uploader_helper.rb +36 -27
- data/app/models/camaleon_cms/custom_fields_relationship.rb +6 -0
- data/app/models/camaleon_cms/media.rb +54 -0
- data/app/models/camaleon_cms/post.rb +1 -0
- data/app/models/camaleon_cms/site.rb +7 -0
- data/app/uploaders/camaleon_cms_aws_uploader.rb +21 -23
- data/app/uploaders/camaleon_cms_local_uploader.rb +20 -26
- data/app/uploaders/camaleon_cms_uploader.rb +17 -45
- data/app/views/camaleon_cms/admin/categories/index.html.erb +2 -2
- data/app/views/camaleon_cms/admin/media/_render_file_item.html.erb +53 -36
- data/app/views/camaleon_cms/admin/media/index.html.erb +1 -1
- data/app/views/camaleon_cms/admin/post_tags/index.html.erb +4 -4
- data/app/views/camaleon_cms/admin/posts/index.html.erb +1 -0
- data/app/views/camaleon_cms/admin/settings/_configuration_settings.html.erb +5 -1
- data/app/views/camaleon_cms/admin/settings/post_types/_form.html.erb +1 -1
- data/app/views/camaleon_cms/default_theme/partials/_comments.html.erb +45 -28
- data/app/views/camaleon_cms/default_theme/single.html.erb +1 -1
- data/config/locales/camaleon_cms/admin/es.yml +1 -0
- data/config/locales/camaleon_cms/admin/js.yml +54 -3
- data/config/locales/camaleon_cms/admin/ru.yml +39 -28
- data/db/migrate/20180124132318_create_media.rb +17 -0
- data/lib/camaleon_cms/version.rb +1 -1
- data/lib/ext/string.rb +8 -0
- data/lib/generators/camaleon_cms/gem_plugin_generator.rb +29 -25
- data/lib/plugin_routes.rb +27 -0
- data/spec/dummy/config/application.rb +1 -0
- data/spec/dummy/config/environments/test.rb +2 -0
- data/spec/dummy/db/schema.rb +1 -140
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/factories/post_type.rb +17 -0
- data/spec/factories/site.rb +8 -0
- data/spec/features/{categories_spec.rb → admin/categories_spec.rb} +1 -1
- data/spec/features/{comments_spec.rb → admin/comments_spec.rb} +16 -9
- data/spec/features/{contact_form_spec.rb → admin/contact_form_spec.rb} +16 -9
- data/spec/features/{content_groups_spec.rb → admin/content_groups_spec.rb} +19 -11
- data/spec/features/{custom_fields_spec.rb → admin/custom_fields_spec.rb} +1 -1
- data/spec/features/{languages_spec.rb → admin/languages_spec.rb} +1 -1
- data/spec/features/{media_spec.rb → admin/media_spec.rb} +1 -1
- data/spec/features/{menus_spec.rb → admin/menus_spec.rb} +2 -2
- data/spec/features/{pages_spec.rb → admin/pages_spec.rb} +1 -1
- data/spec/features/{plugins_spec.rb → admin/plugins_spec.rb} +1 -1
- data/spec/features/{posts_spec.rb → admin/posts_spec.rb} +4 -3
- data/spec/features/admin/session_spec.rb +102 -0
- data/spec/features/{settings_spec.rb → admin/settings_spec.rb} +1 -1
- data/spec/features/{shortcodes_spec.rb → admin/shortcodes_spec.rb} +1 -1
- data/spec/features/{sites_spec.rb → admin/sites_spec.rb} +22 -14
- data/spec/features/{tags_spec.rb → admin/tags_spec.rb} +17 -8
- data/spec/features/{themes_spec.rb → admin/themes_spec.rb} +1 -1
- data/spec/features/{user_roles_spec.rb → admin/user_roles_spec.rb} +25 -19
- data/spec/features/{users_spec.rb → admin/users_spec.rb} +2 -2
- data/spec/features/{widgets_spec.rb → admin/widgets_spec.rb} +19 -12
- data/spec/features/frontend/pages_spec.rb +86 -5
- data/spec/features/frontend/post_type_spec.rb +16 -0
- data/spec/helpers/email_helper_spec.rb +1 -1
- data/spec/helpers/uploader_helper_spec.rb +56 -0
- data/spec/mailers/send_mail_spec.rb +3 -3
- data/spec/{decorators/camaleon_cms/post_decorator_spec.rb → models/post_spec.rb} +3 -3
- data/spec/rails_helper.rb +79 -0
- data/spec/spec_helper.rb +25 -56
- data/spec/support/common.rb +10 -24
- data/spec/support/fixtures/rails.png +0 -0
- data/spec/support/fixtures/rails_tmp.png +0 -0
- metadata +64 -50
- data/app/views/camaleon_cms/admin/media/_files_list.html.erb +0 -2
- data/app/views/camaleon_cms/admin/media/_render_folder_item.html.erb +0 -15
- data/spec/decorators/post_type_spec.rb +0 -13
- data/spec/features/session_spec.rb +0 -74
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rails_helper"
|
2
2
|
describe "the Menus", js: true do
|
3
|
-
|
3
|
+
init_site
|
4
4
|
|
5
5
|
it "Menus list" do
|
6
6
|
admin_sign_in
|
@@ -42,7 +42,7 @@ describe "the Menus", js: true do
|
|
42
42
|
it "Menus Create and Delete" do
|
43
43
|
admin_sign_in
|
44
44
|
visit "#{cama_root_relative_path}/admin/appearances/nav_menus"
|
45
|
-
page.execute_script('
|
45
|
+
page.execute_script('jQuery("#switch_nav_menu_form .btn-danger").click()')
|
46
46
|
confirm_dialog
|
47
47
|
expect(page).to have_css('.alert-success')
|
48
48
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rails_helper"
|
2
2
|
describe "the signin process", js: true do
|
3
|
-
|
3
|
+
init_site
|
4
4
|
|
5
5
|
it "create new post" do
|
6
6
|
admin_sign_in
|
@@ -20,7 +20,7 @@ describe "the signin process", js: true do
|
|
20
20
|
|
21
21
|
it "create edit post" do
|
22
22
|
admin_sign_in
|
23
|
-
visit "#{cama_root_relative_path}/admin/post_type/2/posts/#{
|
23
|
+
visit "#{cama_root_relative_path}/admin/post_type/2/posts/#{@post.id}/edit"
|
24
24
|
wait(2)
|
25
25
|
within("#form-post") do
|
26
26
|
fill_in 'post_title', :with => 'Test Title changed'
|
@@ -29,8 +29,9 @@ describe "the signin process", js: true do
|
|
29
29
|
end
|
30
30
|
click_button 'Update'
|
31
31
|
expect(page).to have_css('.alert-success')
|
32
|
+
|
32
33
|
# visit page in frontend
|
33
|
-
visit
|
34
|
+
visit @post.the_url(as_path: true)
|
34
35
|
expect(page).to have_content("Test Title changed")
|
35
36
|
end
|
36
37
|
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require "rails_helper"
|
2
|
+
describe "the signin process", js: true do
|
3
|
+
init_site
|
4
|
+
it "signs me in not valid" do
|
5
|
+
visit "#{cama_root_relative_path}/admin/login"
|
6
|
+
within("#login_user") do
|
7
|
+
fill_in 'user_username', :with => 'admin'
|
8
|
+
fill_in 'user_password', :with => 'ADMIN'
|
9
|
+
end
|
10
|
+
click_button 'Log In'
|
11
|
+
expect(page).to have_css('#user_username')
|
12
|
+
end
|
13
|
+
|
14
|
+
it "forgot pass" do
|
15
|
+
visit "#{cama_root_relative_path}/admin/forgot"
|
16
|
+
within("#login_user") do
|
17
|
+
fill_in 'user_email', :with => 'admin@local.com'
|
18
|
+
end
|
19
|
+
click_button 'Submit'
|
20
|
+
expect(page).to have_content 'Send email reset success'
|
21
|
+
end
|
22
|
+
|
23
|
+
it "Enable Register" do
|
24
|
+
admin_sign_in
|
25
|
+
visit "#{cama_root_relative_path}/admin/settings/site?tab=config"
|
26
|
+
within '#site_settings_form' do
|
27
|
+
check "options_permit_create_account"
|
28
|
+
click_button 'Submit'
|
29
|
+
end
|
30
|
+
expect(page).to have_css('.alert-success')
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
describe 'user registration' do
|
35
|
+
before(:each) do
|
36
|
+
@site.set_option('permit_create_account', true) # enable user registration
|
37
|
+
end
|
38
|
+
|
39
|
+
it "Enable Register with Captcha" do
|
40
|
+
admin_sign_in
|
41
|
+
visit "#{cama_root_relative_path}/admin/settings/site?tab=config"
|
42
|
+
within '#site_settings_form' do
|
43
|
+
check "options_security_captcha_user_register"
|
44
|
+
click_button 'Submit'
|
45
|
+
end
|
46
|
+
expect(page).to have_css('.alert-success')
|
47
|
+
end
|
48
|
+
|
49
|
+
it "Register User" do
|
50
|
+
visit "#{cama_root_relative_path}/admin/register"
|
51
|
+
within("#login_user") do
|
52
|
+
fill_in 'user[first_name]', :with => 'Name'
|
53
|
+
fill_in 'user[last_name]', :with => 'Last Name'
|
54
|
+
fill_in 'user[email]', :with => 'test@tester.com'
|
55
|
+
fill_in 'user[username]', :with => 'tester'
|
56
|
+
fill_in 'user[password]', :with => 'passsword'
|
57
|
+
fill_in 'user[password_confirmation]', :with => 'passsword'
|
58
|
+
end
|
59
|
+
click_button 'Sign Up'
|
60
|
+
expect(page).to have_css('.alert-success')
|
61
|
+
end
|
62
|
+
|
63
|
+
it "Register User with error in captcha" do
|
64
|
+
@site.set_option('security_captcha_user_register', true) # enable captcha security for user registration
|
65
|
+
visit "#{cama_root_relative_path}/admin/register"
|
66
|
+
within("#login_user") do
|
67
|
+
fill_in 'user[first_name]', :with => 'Name'
|
68
|
+
fill_in 'user[last_name]', :with => 'Last Name'
|
69
|
+
fill_in 'user[email]', :with => "test_#{Time.current.to_i}@tester.com"
|
70
|
+
fill_in 'user[username]', :with => "tester_#{Time.current.to_i}"
|
71
|
+
fill_in 'user[password]', :with => 'passsword'
|
72
|
+
fill_in 'user[password_confirmation]', :with => 'passsword'
|
73
|
+
fill_in 'captcha', :with => 'password'
|
74
|
+
end
|
75
|
+
click_button 'Sign Up'
|
76
|
+
expect(page).not_to have_css('.alert-success')
|
77
|
+
end
|
78
|
+
|
79
|
+
it "Register User with no error in Captcha" do
|
80
|
+
@site.set_option('security_captcha_user_register', true) # enable captcha security for user registration
|
81
|
+
Capybara.using_session("test session") do
|
82
|
+
visit cama_captcha_path(len: 4, t: Time.current.to_i)
|
83
|
+
captcha = page.get_rack_session['cama_captcha']
|
84
|
+
visit "#{cama_root_relative_path}/admin/register"
|
85
|
+
within("#login_user") do
|
86
|
+
fill_in 'user[first_name]', :with => 'Name'
|
87
|
+
fill_in 'user[last_name]', :with => 'Last Name'
|
88
|
+
fill_in 'user[email]', :with => "test_#{Time.current.to_i}@tester.com"
|
89
|
+
fill_in 'user[username]', :with => "tester_#{Time.current.to_i}"
|
90
|
+
fill_in 'user[password]', :with => 'passsword'
|
91
|
+
fill_in 'user[password_confirmation]', :with => 'passsword'
|
92
|
+
fill_in 'captcha', :with => captcha
|
93
|
+
end
|
94
|
+
click_button 'Sign Up'
|
95
|
+
expect(page).to have_css('.alert-success')
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
|
101
|
+
|
102
|
+
end
|
@@ -1,27 +1,34 @@
|
|
1
1
|
require "rails_helper"
|
2
|
+
|
3
|
+
# create a new site
|
4
|
+
def create_site
|
5
|
+
visit "#{cama_root_relative_path}/admin/settings/sites"
|
6
|
+
expect(page).to have_content("List Sites")
|
7
|
+
|
8
|
+
# create user role
|
9
|
+
within '#admin_content' do
|
10
|
+
click_link "Add Site"
|
11
|
+
end
|
12
|
+
expect(page).to have_css("#new_site")
|
13
|
+
within '#new_site' do
|
14
|
+
fill_in "site_slug", with: 'owen'
|
15
|
+
fill_in "site_name", with: 'Owen sub site'
|
16
|
+
click_button "Submit"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
2
20
|
describe "the Sites", js: true do
|
3
|
-
|
21
|
+
init_site
|
4
22
|
|
5
23
|
it "Sites list" do
|
6
24
|
admin_sign_in
|
7
|
-
|
8
|
-
expect(page).to have_content("List Sites")
|
9
|
-
|
10
|
-
# create user role
|
11
|
-
within '#admin_content' do
|
12
|
-
click_link "Add Site"
|
13
|
-
end
|
14
|
-
expect(page).to have_css("#new_site")
|
15
|
-
within '#new_site' do
|
16
|
-
fill_in "site_slug", with: 'owen'
|
17
|
-
fill_in "site_name", with: 'Owen sub site'
|
18
|
-
click_button "Submit"
|
19
|
-
end
|
25
|
+
create_site
|
20
26
|
expect(page).to have_css('.alert-success')
|
21
27
|
end
|
22
28
|
|
23
29
|
it "Site Edit" do
|
24
30
|
admin_sign_in
|
31
|
+
create_site
|
25
32
|
visit "#{cama_root_relative_path}/admin/settings/sites"
|
26
33
|
within '#admin_content' do
|
27
34
|
all(".btn-default").last.click
|
@@ -35,6 +42,7 @@ describe "the Sites", js: true do
|
|
35
42
|
|
36
43
|
it "Site destroy" do
|
37
44
|
admin_sign_in
|
45
|
+
create_site
|
38
46
|
visit "#{cama_root_relative_path}/admin/settings/sites"
|
39
47
|
within '#admin_content' do
|
40
48
|
all(".btn-danger").last.click
|
@@ -1,21 +1,30 @@
|
|
1
1
|
require "rails_helper"
|
2
|
+
|
3
|
+
# create a new post tag
|
4
|
+
def create_tag
|
5
|
+
visit "#{cama_root_relative_path}/admin/post_type/2/post_tags"
|
6
|
+
within("#new_post_tag") do
|
7
|
+
fill_in 'post_tag_name', :with => 'Test tag'
|
8
|
+
fill_in 'post_tag_slug', :with => 'test-tag'
|
9
|
+
end
|
10
|
+
click_button 'Submit'
|
11
|
+
end
|
12
|
+
|
2
13
|
describe "the signin process", js: true do
|
3
|
-
|
14
|
+
init_site
|
4
15
|
|
5
16
|
it "create new tag" do
|
6
17
|
admin_sign_in
|
7
|
-
|
8
|
-
within("#new_post_tag") do
|
9
|
-
fill_in 'post_tag_name', :with => 'Test tag'
|
10
|
-
fill_in 'post_tag_slug', :with => 'test-tag'
|
11
|
-
end
|
12
|
-
click_button 'Submit'
|
18
|
+
create_tag
|
13
19
|
expect(page).to have_css('.alert-success')
|
14
20
|
end
|
15
21
|
|
16
22
|
it "create edit tag" do
|
17
23
|
admin_sign_in
|
18
|
-
|
24
|
+
create_tag
|
25
|
+
within '.page-content-wrap' do
|
26
|
+
all(".btn_edit").last.click
|
27
|
+
end
|
19
28
|
within("#edit_post_tag") do
|
20
29
|
fill_in 'post_tag_name', :with => 'Test tag update'
|
21
30
|
end
|
@@ -1,6 +1,25 @@
|
|
1
1
|
require "rails_helper"
|
2
|
+
|
3
|
+
# create a new user role
|
4
|
+
def create_role
|
5
|
+
visit "#{cama_root_relative_path}/admin/user_roles"
|
6
|
+
within '#admin_content' do
|
7
|
+
click_link "Add User Role"
|
8
|
+
end
|
9
|
+
expect(page).to have_css("#new_user_role")
|
10
|
+
within '#new_user_role' do
|
11
|
+
fill_in "user_role_name", with: 'Test Role'
|
12
|
+
fill_in "user_role_slug", with: 'tester-role'
|
13
|
+
fill_in "user_role_description", with: 'tester descr'
|
14
|
+
check "Comments"
|
15
|
+
check "Themes"
|
16
|
+
click_button "Submit"
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
2
21
|
describe "the User Roles", js: true do
|
3
|
-
|
22
|
+
init_site
|
4
23
|
|
5
24
|
it "User Roles list" do
|
6
25
|
admin_sign_in
|
@@ -10,34 +29,20 @@ describe "the User Roles", js: true do
|
|
10
29
|
expect(page).to have_content("Editor")
|
11
30
|
expect(page).to have_content("Contributor")
|
12
31
|
|
13
|
-
|
14
|
-
within '#admin_content' do
|
15
|
-
click_link "Add User Role"
|
16
|
-
end
|
17
|
-
expect(page).to have_css("#new_user_role")
|
18
|
-
within '#new_user_role' do
|
19
|
-
fill_in "user_role_name", with: 'Test Role'
|
20
|
-
fill_in "user_role_slug", with: 'tester-role'
|
21
|
-
fill_in "user_role_description", with: 'tester descr'
|
22
|
-
check "Comments"
|
23
|
-
check "Themes"
|
24
|
-
click_button "Submit"
|
25
|
-
end
|
32
|
+
create_role
|
26
33
|
expect(page).to have_css('.alert-success')
|
27
34
|
end
|
28
35
|
|
29
36
|
# TODO verification of all roles
|
30
37
|
# it "Users Verify Role" do
|
31
|
-
# admin_sign_in(
|
38
|
+
# admin_sign_in("tester", "tester")
|
32
39
|
# end
|
33
40
|
|
34
41
|
it "User Role Edit" do
|
35
42
|
admin_sign_in
|
36
|
-
|
37
|
-
within '#admin_content' do
|
38
|
-
all(".btn-default").last.click
|
39
|
-
end
|
43
|
+
create_role
|
40
44
|
expect(page).to have_checked_field("Themes")
|
45
|
+
expect(page).to have_checked_field("Comments")
|
41
46
|
within '#edit_user_role' do
|
42
47
|
fill_in "user_role_name", with: 'Test Role updated'
|
43
48
|
fill_in "user_role_slug", with: 'tester-role-updated'
|
@@ -50,6 +55,7 @@ describe "the User Roles", js: true do
|
|
50
55
|
|
51
56
|
it "User Group destroy" do
|
52
57
|
admin_sign_in
|
58
|
+
create_role
|
53
59
|
visit "#{cama_root_relative_path}/admin/user_roles"
|
54
60
|
within '#admin_content' do
|
55
61
|
all(".btn-danger").last.click
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rails_helper"
|
2
2
|
describe "the Users", js: true do
|
3
|
-
|
3
|
+
init_site
|
4
4
|
uname = "testerr_#{Time.current.to_i}"
|
5
5
|
uemail = "testerr_#{Time.current.to_i}@gmail.com"
|
6
6
|
it "Users list" do
|
@@ -29,7 +29,7 @@ describe "the Users", js: true do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "Users login new user" do
|
32
|
-
admin_sign_in(
|
32
|
+
admin_sign_in(uname, "tester123")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "Users Edit" do
|
@@ -1,22 +1,27 @@
|
|
1
1
|
require "rails_helper"
|
2
|
+
|
3
|
+
# create a widget
|
4
|
+
def create_widget
|
5
|
+
within "#view_widget_list" do
|
6
|
+
first('#new_widget_link').click
|
7
|
+
wait_for_ajax
|
8
|
+
end
|
9
|
+
within '#widget_form' do
|
10
|
+
fill_in "widget_main_name", with: "test widget"
|
11
|
+
fill_in "widget_main_slug", with: "test-widget"
|
12
|
+
fill_in "widget_main_description", with: "lorem ipsum"
|
13
|
+
click_button "Submit"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
2
17
|
describe "the Widgets", js: true do
|
3
|
-
|
18
|
+
init_site
|
4
19
|
|
5
20
|
it "Widgets list" do
|
6
21
|
admin_sign_in
|
7
22
|
visit "#{cama_root_relative_path}/admin/appearances/widgets/main"
|
8
23
|
expect(page).to have_css('#view_widget_list')
|
9
|
-
|
10
|
-
first('#new_widget_link').click
|
11
|
-
wait_for_ajax
|
12
|
-
end
|
13
|
-
screenshot_and_save_page
|
14
|
-
within '#widget_form' do
|
15
|
-
fill_in "widget_main_name", with: "test widget"
|
16
|
-
fill_in "widget_main_slug", with: "test-widget"
|
17
|
-
fill_in "widget_main_description", with: "lorem ipsum"
|
18
|
-
click_button "Submit"
|
19
|
-
end
|
24
|
+
create_widget
|
20
25
|
expect(page).to have_css('.alert-success')
|
21
26
|
expect(page).to have_content("test-widget")
|
22
27
|
end
|
@@ -24,6 +29,7 @@ describe "the Widgets", js: true do
|
|
24
29
|
it "Widgets Edit" do
|
25
30
|
admin_sign_in
|
26
31
|
visit "#{cama_root_relative_path}/admin/appearances/widgets/main"
|
32
|
+
create_widget
|
27
33
|
within "#view_widget_list" do
|
28
34
|
first('.edit_link').click
|
29
35
|
wait_for_ajax
|
@@ -41,6 +47,7 @@ describe "the Widgets", js: true do
|
|
41
47
|
it "Widgets destroy" do
|
42
48
|
admin_sign_in
|
43
49
|
visit "#{cama_root_relative_path}/admin/appearances/widgets/main"
|
50
|
+
create_widget
|
44
51
|
within "#view_widget_list" do
|
45
52
|
first('.del_link').click
|
46
53
|
end
|