trusty-cms 2.0.20 → 2.0.21.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +7 -5
- data/Gemfile.lock +32 -20
- data/app/assets/images/admin/add_tab.png +0 -0
- data/app/assets/images/admin/avatar_32x32.png +0 -0
- data/app/assets/images/admin/avatar_64x64.png +0 -0
- data/app/assets/images/admin/avatar_96x96.png +0 -0
- data/app/assets/images/admin/calendar_down.png +0 -0
- data/app/assets/images/admin/collapse.png +0 -0
- data/app/assets/images/admin/collapsed.png +0 -0
- data/app/assets/images/admin/draft_page.png +0 -0
- data/app/assets/images/admin/image.png +0 -0
- data/app/assets/images/admin/javascript.png +0 -0
- data/app/assets/images/admin/layout.png +0 -0
- data/app/assets/images/admin/metadata_toggle.png +0 -0
- data/app/assets/images/admin/minus.png +0 -0
- data/app/assets/images/admin/minus_disabled.png +0 -0
- data/app/assets/images/admin/minus_grey.png +0 -0
- data/app/assets/images/admin/navigation_secondary_separator.png +0 -0
- data/app/assets/images/admin/page.png +0 -0
- data/app/assets/images/admin/plus.png +0 -0
- data/app/assets/images/admin/plus_disabled.png +0 -0
- data/app/assets/images/admin/plus_grey.png +0 -0
- data/app/assets/images/admin/popup_border_background.png +0 -0
- data/app/assets/images/admin/popup_border_bottom_left.png +0 -0
- data/app/assets/images/admin/popup_border_bottom_right.png +0 -0
- data/app/assets/images/admin/popup_border_top_left.png +0 -0
- data/app/assets/images/admin/popup_border_top_right.png +0 -0
- data/app/assets/images/admin/search.png +0 -0
- data/app/assets/images/admin/single_form_shadow.png +0 -0
- data/app/assets/images/admin/snippet.png +0 -0
- data/app/assets/images/admin/status_background.png +0 -0
- data/app/assets/images/admin/status_bottom_left.png +0 -0
- data/app/assets/images/admin/status_bottom_right.png +0 -0
- data/app/assets/images/admin/status_top_left.png +0 -0
- data/app/assets/images/admin/status_top_right.png +0 -0
- data/app/assets/images/admin/stylesheet.png +0 -0
- data/app/assets/images/admin/tab_close.png +0 -0
- data/app/assets/images/admin/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/images/admin/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/app/assets/images/admin/ui-icons_222222_256x240.png +0 -0
- data/app/assets/images/admin/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/images/admin/ui-icons_454545_256x240.png +0 -0
- data/app/assets/images/admin/ui-icons_888888_256x240.png +0 -0
- data/app/assets/images/admin/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/images/admin/upload.png +0 -0
- data/app/assets/images/admin/virtual_page.png +0 -0
- data/app/assets/images/radiant/radiant-badge-color.png +0 -0
- data/app/controllers/admin/password_resets_controller.rb +25 -0
- data/app/mailers/password_mailer.rb +8 -0
- data/app/models/user.rb +28 -18
- data/app/views/admin/password_resets/edit.html.haml +23 -0
- data/app/views/admin/password_resets/new.html.haml +14 -0
- data/app/views/admin/welcome/login.html.haml +1 -0
- data/app/views/password_mailer/password_reset.html.haml +3 -0
- data/config/routes.rb +1 -0
- data/coverage/assets/0.10.0/application.css +799 -0
- data/coverage/assets/0.10.0/application.js +1707 -0
- data/coverage/assets/0.10.0/colorbox/border.png +0 -0
- data/coverage/assets/0.10.0/colorbox/controls.png +0 -0
- data/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
- data/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
- data/coverage/assets/0.10.0/favicon_green.png +0 -0
- data/coverage/assets/0.10.0/favicon_red.png +0 -0
- data/coverage/assets/0.10.0/favicon_yellow.png +0 -0
- data/coverage/assets/0.10.0/loading.gif +0 -0
- data/coverage/assets/0.10.0/magnify.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/coverage/index.html +6306 -0
- data/db/migrate/20160527141249_add_password_reset_to_users.rb +6 -0
- data/lib/trusty_cms.rb +1 -1
- data/spec/controllers/application_controller_spec.rb +60 -0
- data/spec/controllers/users_controller_spec.rb +6 -0
- data/spec/controllers/welcome_controller_spec.rb +6 -0
- data/spec/dummy/db/schema.rb +3 -3
- data/spec/dummy/log/development.log +1 -0
- data/spec/dummy/log/test.log +16101 -0
- data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
- data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
- data/spec/factories/layout.rb +17 -0
- data/spec/factories/page.rb +63 -0
- data/spec/factories/page_part.rb +8 -0
- data/spec/factories/user.rb +35 -0
- data/spec/models/layout_spec.rb +29 -0
- data/spec/routing/welcome_routing_spec.rb +18 -0
- data/spec/spec_helper.rb +11 -2
- data/trusty_cms.gemspec +1 -1
- metadata +57 -4
data/lib/trusty_cms.rb
CHANGED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ApplicationController, :type => :controller do
|
4
|
+
routes { TrustyCms::Engine.routes }
|
5
|
+
|
6
|
+
it 'should initialize the javascript and stylesheets arrays' do
|
7
|
+
controller.send :set_javascripts_and_stylesheets
|
8
|
+
expect(controller.send(:instance_variable_get, :@javascripts)).not_to be_nil
|
9
|
+
expect(controller.send(:instance_variable_get, :@javascripts)).to be_instance_of(Array)
|
10
|
+
expect(controller.send(:instance_variable_get, :@stylesheets)).not_to be_nil
|
11
|
+
expect(controller.send(:instance_variable_get, :@stylesheets)).to be_instance_of(Array)
|
12
|
+
end
|
13
|
+
|
14
|
+
describe 'self.template_name' do
|
15
|
+
it "should return 'index' when the controller action_name is 'index'" do
|
16
|
+
allow(controller).to receive(:action_name).and_return('index')
|
17
|
+
expect(controller.template_name).to eq('index')
|
18
|
+
end
|
19
|
+
['new', 'create'].each do |action|
|
20
|
+
it "should return 'new' when the action_name is #{action}" do
|
21
|
+
allow(controller).to receive(:action_name).and_return(action)
|
22
|
+
expect(controller.template_name).to eq('new')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
['edit', 'update'].each do |action|
|
26
|
+
it "should return 'edit' when the action_name is #{action}" do
|
27
|
+
allow(controller).to receive(:action_name).and_return(action)
|
28
|
+
expect(controller.template_name).to eq('edit')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
['remove', 'destroy'].each do |action|
|
32
|
+
it "should return 'remove' when the action_name is #{action}" do
|
33
|
+
allow(controller).to receive(:action_name).and_return(action)
|
34
|
+
expect(controller.template_name).to eq('remove')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
it "should return 'show' when the action_name is show" do
|
38
|
+
allow(controller).to receive(:action_name).and_return('show')
|
39
|
+
expect(controller.template_name).to eq('show')
|
40
|
+
end
|
41
|
+
it "should return the action_name when the action_name is a non-standard name" do
|
42
|
+
allow(controller).to receive(:action_name).and_return('other')
|
43
|
+
expect(controller.template_name).to eq('other')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe "set_timezone" do
|
48
|
+
it "should use TrustyCms::Config['local.timezone']" do
|
49
|
+
TrustyCms::Config['local.timezone'] = 'Kuala Lumpur'
|
50
|
+
controller.send(:set_timezone)
|
51
|
+
expect(Time.zone.name).to eq('Kuala Lumpur')
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should default to config.time_zone" do
|
55
|
+
TrustyCms::Config.initialize_cache # to clear out setting from previous tests
|
56
|
+
controller.send(:set_timezone)
|
57
|
+
expect(Time.zone.name).to eq('UTC')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -104,15 +104,15 @@ ActiveRecord::Schema.define(version: 20120209231801) do
|
|
104
104
|
t.string "email", limit: 255
|
105
105
|
t.string "login", limit: 40, default: "", null: false
|
106
106
|
t.string "password", limit: 40
|
107
|
+
t.boolean "admin", default: false, null: false
|
108
|
+
t.boolean "designer", default: false, null: false
|
107
109
|
t.datetime "created_at"
|
108
110
|
t.datetime "updated_at"
|
109
111
|
t.integer "created_by_id", limit: 4
|
110
112
|
t.integer "updated_by_id", limit: 4
|
111
|
-
t.
|
112
|
-
t.boolean "designer", default: false, null: false
|
113
|
+
t.string "salt", limit: 255
|
113
114
|
t.text "notes", limit: 65535
|
114
115
|
t.integer "lock_version", limit: 4, default: 0
|
115
|
-
t.string "salt", limit: 255
|
116
116
|
t.string "session_token", limit: 255
|
117
117
|
t.string "locale", limit: 255
|
118
118
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
[1m[36m (5.6ms)[0m [1mSELECT DISTINCT class_name FROM pages WHERE class_name <> '' AND class_name IS NOT NULL[0m
|