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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Gemfile +7 -5
  4. data/Gemfile.lock +32 -20
  5. data/app/assets/images/admin/add_tab.png +0 -0
  6. data/app/assets/images/admin/avatar_32x32.png +0 -0
  7. data/app/assets/images/admin/avatar_64x64.png +0 -0
  8. data/app/assets/images/admin/avatar_96x96.png +0 -0
  9. data/app/assets/images/admin/calendar_down.png +0 -0
  10. data/app/assets/images/admin/collapse.png +0 -0
  11. data/app/assets/images/admin/collapsed.png +0 -0
  12. data/app/assets/images/admin/draft_page.png +0 -0
  13. data/app/assets/images/admin/image.png +0 -0
  14. data/app/assets/images/admin/javascript.png +0 -0
  15. data/app/assets/images/admin/layout.png +0 -0
  16. data/app/assets/images/admin/metadata_toggle.png +0 -0
  17. data/app/assets/images/admin/minus.png +0 -0
  18. data/app/assets/images/admin/minus_disabled.png +0 -0
  19. data/app/assets/images/admin/minus_grey.png +0 -0
  20. data/app/assets/images/admin/navigation_secondary_separator.png +0 -0
  21. data/app/assets/images/admin/page.png +0 -0
  22. data/app/assets/images/admin/plus.png +0 -0
  23. data/app/assets/images/admin/plus_disabled.png +0 -0
  24. data/app/assets/images/admin/plus_grey.png +0 -0
  25. data/app/assets/images/admin/popup_border_background.png +0 -0
  26. data/app/assets/images/admin/popup_border_bottom_left.png +0 -0
  27. data/app/assets/images/admin/popup_border_bottom_right.png +0 -0
  28. data/app/assets/images/admin/popup_border_top_left.png +0 -0
  29. data/app/assets/images/admin/popup_border_top_right.png +0 -0
  30. data/app/assets/images/admin/search.png +0 -0
  31. data/app/assets/images/admin/single_form_shadow.png +0 -0
  32. data/app/assets/images/admin/snippet.png +0 -0
  33. data/app/assets/images/admin/status_background.png +0 -0
  34. data/app/assets/images/admin/status_bottom_left.png +0 -0
  35. data/app/assets/images/admin/status_bottom_right.png +0 -0
  36. data/app/assets/images/admin/status_top_left.png +0 -0
  37. data/app/assets/images/admin/status_top_right.png +0 -0
  38. data/app/assets/images/admin/stylesheet.png +0 -0
  39. data/app/assets/images/admin/tab_close.png +0 -0
  40. data/app/assets/images/admin/ui-bg_flat_75_ffffff_40x100.png +0 -0
  41. data/app/assets/images/admin/ui-bg_glass_65_ffffff_1x400.png +0 -0
  42. data/app/assets/images/admin/ui-icons_222222_256x240.png +0 -0
  43. data/app/assets/images/admin/ui-icons_2e83ff_256x240.png +0 -0
  44. data/app/assets/images/admin/ui-icons_454545_256x240.png +0 -0
  45. data/app/assets/images/admin/ui-icons_888888_256x240.png +0 -0
  46. data/app/assets/images/admin/ui-icons_cd0a0a_256x240.png +0 -0
  47. data/app/assets/images/admin/upload.png +0 -0
  48. data/app/assets/images/admin/virtual_page.png +0 -0
  49. data/app/assets/images/radiant/radiant-badge-color.png +0 -0
  50. data/app/controllers/admin/password_resets_controller.rb +25 -0
  51. data/app/mailers/password_mailer.rb +8 -0
  52. data/app/models/user.rb +28 -18
  53. data/app/views/admin/password_resets/edit.html.haml +23 -0
  54. data/app/views/admin/password_resets/new.html.haml +14 -0
  55. data/app/views/admin/welcome/login.html.haml +1 -0
  56. data/app/views/password_mailer/password_reset.html.haml +3 -0
  57. data/config/routes.rb +1 -0
  58. data/coverage/assets/0.10.0/application.css +799 -0
  59. data/coverage/assets/0.10.0/application.js +1707 -0
  60. data/coverage/assets/0.10.0/colorbox/border.png +0 -0
  61. data/coverage/assets/0.10.0/colorbox/controls.png +0 -0
  62. data/coverage/assets/0.10.0/colorbox/loading.gif +0 -0
  63. data/coverage/assets/0.10.0/colorbox/loading_background.png +0 -0
  64. data/coverage/assets/0.10.0/favicon_green.png +0 -0
  65. data/coverage/assets/0.10.0/favicon_red.png +0 -0
  66. data/coverage/assets/0.10.0/favicon_yellow.png +0 -0
  67. data/coverage/assets/0.10.0/loading.gif +0 -0
  68. data/coverage/assets/0.10.0/magnify.png +0 -0
  69. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  70. data/coverage/assets/0.10.0/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  71. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  72. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  73. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  74. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  75. data/coverage/assets/0.10.0/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  76. data/coverage/assets/0.10.0/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  77. data/coverage/assets/0.10.0/smoothness/images/ui-icons_222222_256x240.png +0 -0
  78. data/coverage/assets/0.10.0/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  79. data/coverage/assets/0.10.0/smoothness/images/ui-icons_454545_256x240.png +0 -0
  80. data/coverage/assets/0.10.0/smoothness/images/ui-icons_888888_256x240.png +0 -0
  81. data/coverage/assets/0.10.0/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  82. data/coverage/index.html +6306 -0
  83. data/db/migrate/20160527141249_add_password_reset_to_users.rb +6 -0
  84. data/lib/trusty_cms.rb +1 -1
  85. data/spec/controllers/application_controller_spec.rb +60 -0
  86. data/spec/controllers/users_controller_spec.rb +6 -0
  87. data/spec/controllers/welcome_controller_spec.rb +6 -0
  88. data/spec/dummy/db/schema.rb +3 -3
  89. data/spec/dummy/log/development.log +1 -0
  90. data/spec/dummy/log/test.log +16101 -0
  91. data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
  92. data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +0 -0
  93. data/spec/factories/layout.rb +17 -0
  94. data/spec/factories/page.rb +63 -0
  95. data/spec/factories/page_part.rb +8 -0
  96. data/spec/factories/user.rb +35 -0
  97. data/spec/models/layout_spec.rb +29 -0
  98. data/spec/routing/welcome_routing_spec.rb +18 -0
  99. data/spec/spec_helper.rb +11 -2
  100. data/trusty_cms.gemspec +1 -1
  101. metadata +57 -4
@@ -0,0 +1,6 @@
1
+ class AddPasswordResetToUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :password_reset_token, :string
4
+ add_column :users, :password_reset_sent_at, :datetime
5
+ end
6
+ end
data/lib/trusty_cms.rb CHANGED
@@ -2,6 +2,6 @@ TRUSTY_CMS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), "..")) unle
2
2
 
3
3
  unless defined? TrustyCms::VERSION
4
4
  module TrustyCms
5
- VERSION = "2.0.20"
5
+ VERSION = "2.0.21.alpha"
6
6
  end
7
7
  end
@@ -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
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe Admin::UsersController, :type => :controller do
4
+ routes { TrustyCms::Engine.routes }
5
+
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Admin::WelcomeController, :type => :controller do
4
+ routes { TrustyCms::Engine.routes }
5
+
6
+ end
@@ -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.boolean "admin", default: false, null: false
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
+  (5.6ms) SELECT DISTINCT class_name FROM pages WHERE class_name <> '' AND class_name IS NOT NULL