sunrise-cms 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/app/controllers/sunrise/manager_controller.rb +4 -4
  2. data/app/helpers/sunrise/structure_helper.rb +1 -1
  3. data/lib/sunrise/abstract_model.rb +2 -3
  4. data/lib/sunrise/config/association.rb +4 -0
  5. data/lib/sunrise/config/model.rb +0 -1
  6. data/lib/sunrise/version.rb +1 -1
  7. data/spec/dummy/log/test.log +2629 -0
  8. data/spec/models/sunrise/abstract_model_spec.rb +1 -1
  9. data/spec/tmp/app/models/defaults/ability.rb +18 -0
  10. data/spec/tmp/app/models/defaults/asset.rb +7 -0
  11. data/spec/tmp/app/models/defaults/attachment_file.rb +5 -0
  12. data/spec/tmp/app/models/defaults/avatar.rb +7 -0
  13. data/spec/tmp/app/models/defaults/picture.rb +7 -0
  14. data/spec/tmp/app/models/defaults/position_type.rb +7 -0
  15. data/spec/tmp/app/models/defaults/role_type.rb +8 -0
  16. data/spec/tmp/app/models/defaults/settings.rb +3 -0
  17. data/spec/tmp/app/models/defaults/structure.rb +9 -0
  18. data/spec/tmp/app/models/defaults/structure_type.rb +9 -0
  19. data/spec/tmp/app/models/defaults/user.rb +13 -0
  20. data/spec/tmp/app/models/sunrise/sunrise_navigation.rb +14 -0
  21. data/spec/tmp/app/models/sunrise/sunrise_page.rb +10 -0
  22. data/spec/tmp/app/models/sunrise/sunrise_structure.rb +35 -0
  23. data/spec/tmp/app/models/sunrise/sunrise_user.rb +50 -0
  24. data/spec/tmp/app/uploaders/attachment_file_uploader.rb +5 -0
  25. data/spec/tmp/app/uploaders/avatar_uploader.rb +15 -0
  26. data/spec/tmp/app/uploaders/picture_uploader.rb +15 -0
  27. data/spec/tmp/app/views/layouts/application.html.erb +22 -0
  28. data/spec/tmp/app/views/pages/show.html.erb +2 -0
  29. data/spec/tmp/app/views/shared/_notice.html.erb +17 -0
  30. data/spec/tmp/config/application.rb +63 -0
  31. data/spec/tmp/config/database.yml.sample +34 -0
  32. data/spec/tmp/config/initializers/sunrise.rb +18 -0
  33. data/spec/tmp/config/logrotate-config.sample +9 -0
  34. data/spec/tmp/config/nginx-config.sample +99 -0
  35. data/spec/tmp/config/routes.rb +9 -0
  36. data/spec/tmp/db/seeds.rb +31 -0
  37. data/spec/tmp/spec/controllers/pages_controller_spec.rb +22 -0
  38. data/spec/tmp/spec/controllers/welcome_controller_spec.rb +18 -0
  39. data/spec/tmp/spec/factories/structure_factory.rb +22 -0
  40. data/spec/tmp/spec/factories/user_factory.rb +61 -0
  41. data/spec/tmp/spec/spec_helper.rb +37 -0
  42. data/spec/tmp/spec/support/helpers/controller_macros.rb +52 -0
  43. metadata +69 -1
@@ -0,0 +1,61 @@
1
+ # encoding: utf-8
2
+ FactoryGirl.define do
3
+ factory :admin_user, :class => User do |user|
4
+ user.name 'Admin'
5
+ user.email { FactoryGirl.generate(:email) }
6
+ user.password 'password'
7
+ user.password_confirmation 'password'
8
+
9
+ user.after(:build) do |u|
10
+ u.roles.build(:role_type => RoleType.admin)
11
+ u.skip_confirmation!
12
+ end
13
+ end
14
+
15
+ factory :redactor_user, :class => User do |user|
16
+ user.name 'Redactor'
17
+ user.email { FactoryGirl.generate(:email) }
18
+ user.password 'password'
19
+ user.password_confirmation 'password'
20
+
21
+ user.after(:build) do |u|
22
+ u.roles.build(:role_type => RoleType.redactor)
23
+ u.skip_confirmation!
24
+ end
25
+ end
26
+
27
+ factory :moderator_user, :class => User do |user|
28
+ user.name 'Redactor'
29
+ user.email { FactoryGirl.generate(:email) }
30
+ user.password 'password'
31
+ user.password_confirmation 'password'
32
+
33
+ user.after(:build) do |u|
34
+ u.roles.build(:role_type => RoleType.moderator)
35
+ u.skip_confirmation!
36
+ end
37
+ end
38
+
39
+ factory :default_user, :class => User do |user|
40
+ user.name 'Test'
41
+ user.email { FactoryGirl.generate(:email) }
42
+ user.password 'password'
43
+ user.password_confirmation 'password'
44
+
45
+ user.after(:build) do |u|
46
+ u.roles.build(:role_type => RoleType.default)
47
+ u.skip_confirmation!
48
+ end
49
+ end
50
+
51
+ factory :user, :class => User do |user|
52
+ user.name 'Test'
53
+ user.email { FactoryGirl.generate(:email) }
54
+ user.password 'password'
55
+ user.password_confirmation 'password'
56
+ end
57
+
58
+ sequence :email do |n|
59
+ "testing#{n}@example.com"
60
+ end
61
+ end
@@ -0,0 +1,37 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ require File.expand_path("../../config/environment", __FILE__)
4
+ require 'rspec/rails'
5
+
6
+ # Requires supporting ruby files with custom matchers and macros, etc,
7
+ # in spec/support/ and its subdirectories.
8
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+ # == Mock Framework
12
+ #
13
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
14
+ #
15
+ # config.mock_with :mocha
16
+ # config.mock_with :flexmock
17
+ # config.mock_with :rr
18
+ config.mock_with :rspec
19
+
20
+ config.include Devise::TestHelpers, :type => :controller
21
+ config.extend ControllerMacros, :type => :controller
22
+
23
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
24
+ # examples within a transaction, remove the following line or assign false
25
+ # instead of true.
26
+ config.use_transactional_fixtures = false
27
+
28
+ require 'database_cleaner'
29
+ config.before(:suite) do
30
+ DatabaseCleaner.strategy = :truncation
31
+ DatabaseCleaner.clean
32
+ end
33
+
34
+ config.after(:all) do
35
+ DatabaseCleaner.clean
36
+ end
37
+ end
@@ -0,0 +1,52 @@
1
+ # encoding: utf-8
2
+ module ControllerMacros
3
+ def login_admin
4
+ before(:all) do
5
+ @admin = FactoryGirl.create(:admin_user)
6
+ end
7
+
8
+ before(:each) do
9
+ sign_out :user
10
+ sign_in @admin
11
+ end
12
+ end
13
+
14
+ def login_default
15
+ before(:all) do
16
+ @user = FactoryGirl.create(:default_user)
17
+ end
18
+
19
+ before(:each) do
20
+ sign_out :user
21
+ sign_in @user
22
+ end
23
+ end
24
+
25
+ def login_redactor
26
+ before(:all) do
27
+ @user = FactoryGirl.create(:redactor_user)
28
+ end
29
+
30
+ before(:each) do
31
+ sign_out :user
32
+ sign_in @user
33
+ end
34
+ end
35
+
36
+ def login_moderator
37
+ before(:all) do
38
+ @user = FactoryGirl.create(:moderator_user)
39
+ end
40
+
41
+ before(:each) do
42
+ sign_out :user
43
+ sign_in @user
44
+ end
45
+ end
46
+
47
+ def user_logout
48
+ before(:each) do
49
+ sign_out :user
50
+ end
51
+ end
52
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunrise-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -640,6 +640,40 @@ files:
640
640
  - Rakefile
641
641
  - README.md
642
642
  - CHANGELOG.rdoc
643
+ - spec/tmp/spec/support/helpers/controller_macros.rb
644
+ - spec/tmp/spec/spec_helper.rb
645
+ - spec/tmp/spec/factories/structure_factory.rb
646
+ - spec/tmp/spec/factories/user_factory.rb
647
+ - spec/tmp/spec/controllers/pages_controller_spec.rb
648
+ - spec/tmp/spec/controllers/welcome_controller_spec.rb
649
+ - spec/tmp/app/views/layouts/application.html.erb
650
+ - spec/tmp/app/views/pages/show.html.erb
651
+ - spec/tmp/app/views/shared/_notice.html.erb
652
+ - spec/tmp/app/models/defaults/role_type.rb
653
+ - spec/tmp/app/models/defaults/avatar.rb
654
+ - spec/tmp/app/models/defaults/asset.rb
655
+ - spec/tmp/app/models/defaults/settings.rb
656
+ - spec/tmp/app/models/defaults/position_type.rb
657
+ - spec/tmp/app/models/defaults/picture.rb
658
+ - spec/tmp/app/models/defaults/structure.rb
659
+ - spec/tmp/app/models/defaults/attachment_file.rb
660
+ - spec/tmp/app/models/defaults/ability.rb
661
+ - spec/tmp/app/models/defaults/structure_type.rb
662
+ - spec/tmp/app/models/defaults/user.rb
663
+ - spec/tmp/app/models/sunrise/sunrise_user.rb
664
+ - spec/tmp/app/models/sunrise/sunrise_page.rb
665
+ - spec/tmp/app/models/sunrise/sunrise_navigation.rb
666
+ - spec/tmp/app/models/sunrise/sunrise_structure.rb
667
+ - spec/tmp/app/uploaders/attachment_file_uploader.rb
668
+ - spec/tmp/app/uploaders/picture_uploader.rb
669
+ - spec/tmp/app/uploaders/avatar_uploader.rb
670
+ - spec/tmp/config/routes.rb
671
+ - spec/tmp/config/application.rb
672
+ - spec/tmp/config/database.yml.sample
673
+ - spec/tmp/config/nginx-config.sample
674
+ - spec/tmp/config/logrotate-config.sample
675
+ - spec/tmp/config/initializers/sunrise.rb
676
+ - spec/tmp/db/seeds.rb
643
677
  - spec/support/hooks/structure.rb
644
678
  - spec/support/helpers/controller_macros.rb
645
679
  - spec/support/helpers/controller_helper.rb
@@ -775,6 +809,40 @@ signing_key:
775
809
  specification_version: 3
776
810
  summary: Rails CMS
777
811
  test_files:
812
+ - spec/tmp/spec/support/helpers/controller_macros.rb
813
+ - spec/tmp/spec/spec_helper.rb
814
+ - spec/tmp/spec/factories/structure_factory.rb
815
+ - spec/tmp/spec/factories/user_factory.rb
816
+ - spec/tmp/spec/controllers/pages_controller_spec.rb
817
+ - spec/tmp/spec/controllers/welcome_controller_spec.rb
818
+ - spec/tmp/app/views/layouts/application.html.erb
819
+ - spec/tmp/app/views/pages/show.html.erb
820
+ - spec/tmp/app/views/shared/_notice.html.erb
821
+ - spec/tmp/app/models/defaults/role_type.rb
822
+ - spec/tmp/app/models/defaults/avatar.rb
823
+ - spec/tmp/app/models/defaults/asset.rb
824
+ - spec/tmp/app/models/defaults/settings.rb
825
+ - spec/tmp/app/models/defaults/position_type.rb
826
+ - spec/tmp/app/models/defaults/picture.rb
827
+ - spec/tmp/app/models/defaults/structure.rb
828
+ - spec/tmp/app/models/defaults/attachment_file.rb
829
+ - spec/tmp/app/models/defaults/ability.rb
830
+ - spec/tmp/app/models/defaults/structure_type.rb
831
+ - spec/tmp/app/models/defaults/user.rb
832
+ - spec/tmp/app/models/sunrise/sunrise_user.rb
833
+ - spec/tmp/app/models/sunrise/sunrise_page.rb
834
+ - spec/tmp/app/models/sunrise/sunrise_navigation.rb
835
+ - spec/tmp/app/models/sunrise/sunrise_structure.rb
836
+ - spec/tmp/app/uploaders/attachment_file_uploader.rb
837
+ - spec/tmp/app/uploaders/picture_uploader.rb
838
+ - spec/tmp/app/uploaders/avatar_uploader.rb
839
+ - spec/tmp/config/routes.rb
840
+ - spec/tmp/config/application.rb
841
+ - spec/tmp/config/database.yml.sample
842
+ - spec/tmp/config/nginx-config.sample
843
+ - spec/tmp/config/logrotate-config.sample
844
+ - spec/tmp/config/initializers/sunrise.rb
845
+ - spec/tmp/db/seeds.rb
778
846
  - spec/support/hooks/structure.rb
779
847
  - spec/support/helpers/controller_macros.rb
780
848
  - spec/support/helpers/controller_helper.rb