sunrise-cms 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/README.md +14 -2
  3. data/app/assets/stylesheets/sunrise/main.css +4 -4
  4. data/app/controllers/sunrise/manager_controller.rb +1 -0
  5. data/app/views/sunrise/manager/_field.html.erb +1 -1
  6. data/app/views/sunrise/manager/_nested_field.html.erb +1 -1
  7. data/lib/sunrise/config/field.rb +1 -3
  8. data/lib/sunrise/version.rb +1 -1
  9. data/spec/dummy/log/test.log +4210 -0
  10. data/spec/requests/manager/default/new_spec.rb +11 -0
  11. metadata +2 -70
  12. data/spec/tmp/app/models/defaults/ability.rb +0 -18
  13. data/spec/tmp/app/models/defaults/asset.rb +0 -7
  14. data/spec/tmp/app/models/defaults/attachment_file.rb +0 -5
  15. data/spec/tmp/app/models/defaults/avatar.rb +0 -7
  16. data/spec/tmp/app/models/defaults/picture.rb +0 -7
  17. data/spec/tmp/app/models/defaults/position_type.rb +0 -7
  18. data/spec/tmp/app/models/defaults/role_type.rb +0 -8
  19. data/spec/tmp/app/models/defaults/settings.rb +0 -6
  20. data/spec/tmp/app/models/defaults/structure.rb +0 -10
  21. data/spec/tmp/app/models/defaults/structure_type.rb +0 -9
  22. data/spec/tmp/app/models/defaults/user.rb +0 -14
  23. data/spec/tmp/app/models/sunrise/sunrise_navigation.rb +0 -14
  24. data/spec/tmp/app/models/sunrise/sunrise_page.rb +0 -10
  25. data/spec/tmp/app/models/sunrise/sunrise_structure.rb +0 -35
  26. data/spec/tmp/app/models/sunrise/sunrise_user.rb +0 -50
  27. data/spec/tmp/app/uploaders/attachment_file_uploader.rb +0 -5
  28. data/spec/tmp/app/uploaders/avatar_uploader.rb +0 -15
  29. data/spec/tmp/app/uploaders/picture_uploader.rb +0 -15
  30. data/spec/tmp/app/views/layouts/application.html.erb +0 -22
  31. data/spec/tmp/app/views/pages/show.html.erb +0 -2
  32. data/spec/tmp/app/views/shared/_notice.html.erb +0 -17
  33. data/spec/tmp/config/application.rb +0 -63
  34. data/spec/tmp/config/database.yml.sample +0 -34
  35. data/spec/tmp/config/initializers/sunrise.rb +0 -51
  36. data/spec/tmp/config/logrotate-config.sample +0 -9
  37. data/spec/tmp/config/nginx-config.sample +0 -67
  38. data/spec/tmp/config/routes.rb +0 -10
  39. data/spec/tmp/db/seeds.rb +0 -30
  40. data/spec/tmp/spec/controllers/pages_controller_spec.rb +0 -22
  41. data/spec/tmp/spec/controllers/welcome_controller_spec.rb +0 -18
  42. data/spec/tmp/spec/factories/structure_factory.rb +0 -22
  43. data/spec/tmp/spec/factories/user_factory.rb +0 -61
  44. data/spec/tmp/spec/spec_helper.rb +0 -37
  45. data/spec/tmp/spec/support/helpers/controller_macros.rb +0 -52
@@ -1,10 +0,0 @@
1
- Rails.application.routes.draw do
2
- mount Sunrise::Engine => '/manage'
3
-
4
- devise_for :users
5
-
6
- resources :pages, :only => [:show]
7
- resources :posts, :only => [:index, :show]
8
-
9
- root :to => "welcome#index"
10
- end
data/spec/tmp/db/seeds.rb DELETED
@@ -1,30 +0,0 @@
1
- # encoding: utf-8
2
-
3
- def insert_user
4
- User.truncate!
5
- password = Rails.env.production? ? Devise.friendly_token : (1..9).to_a.join
6
-
7
- admin = User.new do |u|
8
- u.name = "Administrator"
9
- u.email = 'dev@fodojo.com'
10
- u.password = password
11
- u.password_confirmation = password
12
- u.login = 'admin' if u.respond_to?(:login)
13
- u.role_type = RoleType.admin
14
- end
15
-
16
- admin.skip_confirmation!
17
- admin.save!
18
-
19
- puts "Admin: #{admin.email}, #{admin.password}"
20
- end
21
-
22
- def insert_structures
23
- Structure.truncate!
24
-
25
- main_page = Structure.create!(title: "Главная страница", slug: "main-page", structure_type: StructureType.main, parent: nil)
26
- # Structure.create!(title: "Трансляции", slug: "broadcasts", structure_type: StructureType.broadcasts, parent: main_page)
27
- end
28
-
29
- insert_user
30
- insert_structures
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe PagesController do
4
- render_views
5
-
6
- before(:all) do
7
- @root = FactoryGirl.create(:structure_main)
8
- end
9
-
10
- context "page" do
11
- before(:each) { @page = FactoryGirl.create(:structure_page, :parent => @root) }
12
-
13
- it "should render show action" do
14
- get :show, :id => @page.slug
15
-
16
- assigns(:structure).should == @page
17
-
18
- response.should be_success
19
- response.should render_template('show')
20
- end
21
- end
22
- end
@@ -1,18 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe WelcomeController do
4
- render_views
5
-
6
- before(:each) do
7
- @root = FactoryGirl.create(:structure_main)
8
- end
9
-
10
- it "should render index action" do
11
- get :index
12
-
13
- assigns(:structure).should == @root
14
-
15
- response.should be_success
16
- response.should render_template('index')
17
- end
18
- end
@@ -1,22 +0,0 @@
1
- # encoding: utf-8
2
- FactoryGirl.define do
3
- factory :structure_page, :class => Structure do
4
- title 'Structure'
5
- slug { FactoryGirl.generate(:slug) }
6
- structure_type StructureType.page
7
- position_type PositionType.menu
8
- is_visible true
9
- end
10
-
11
- factory :structure_main, :class => Structure do
12
- title "Main page"
13
- slug "main-page"
14
- structure_type StructureType.main
15
- position_type PositionType.default
16
- is_visible true
17
- end
18
-
19
- sequence :slug do |n|
20
- "slug#{n}"
21
- end
22
- end
@@ -1,61 +0,0 @@
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
@@ -1,37 +0,0 @@
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
@@ -1,52 +0,0 @@
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