constructor-cms 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Guardfile +1 -3
- data/constructor-cms.gemspec +1 -0
- data/core/app/controllers/constructor_core/users_controller.rb +0 -2
- data/core/app/views/constructor_core/sessions/new.html.haml +5 -5
- data/core/app/views/constructor_core/users/profile.haml +3 -3
- data/core/app/views/layouts/constructor_core/application.haml +12 -12
- data/core/config/routes.rb +1 -1
- data/core/lib/constructor_core/version.rb +1 -1
- data/lib/constructor-cms/engine.rb +1 -1
- data/pages/app/controllers/constructor_pages/pages_controller.rb +11 -6
- data/pages/app/controllers/constructor_pages/templates_controller.rb +2 -1
- data/pages/app/helpers/constructor_pages/move_helper.rb +2 -2
- data/pages/app/helpers/constructor_pages/pages_helper.rb +2 -0
- data/pages/app/helpers/constructor_pages/templates_helper.rb +2 -0
- data/pages/app/helpers/constructor_pages/treeview_helper.rb +33 -0
- data/pages/app/models/constructor_pages/page.rb +4 -2
- data/pages/app/views/constructor_pages/fields/_form.haml +10 -10
- data/pages/app/views/constructor_pages/fields/types/_html.haml +1 -1
- data/pages/app/views/constructor_pages/fields/types/_image.haml +1 -1
- data/pages/app/views/constructor_pages/fields/types/_integer.haml +1 -1
- data/pages/app/views/constructor_pages/fields/types/_string.haml +1 -1
- data/pages/app/views/constructor_pages/fields/types/_text.haml +1 -1
- data/pages/app/views/constructor_pages/pages/_breadcrumbs.haml +2 -2
- data/pages/app/views/constructor_pages/pages/_form.haml +30 -30
- data/pages/app/views/constructor_pages/pages/index.haml +35 -45
- data/pages/app/views/constructor_pages/partials/_arrow_buttons.haml +6 -0
- data/pages/app/views/constructor_pages/templates/_form.haml +23 -18
- data/pages/app/views/constructor_pages/templates/index.haml +11 -30
- data/pages/config/locales/en.yml +1 -0
- data/pages/config/locales/ru.yml +1 -0
- data/pages/config/routes.rb +16 -21
- data/pages/spec/features/constructor_pages/pages_controller_spec.rb +280 -0
- data/pages/spec/models/constructor_pages/field_model_spec.rb +12 -16
- data/pages/spec/models/constructor_pages/page_model_spec.rb +2 -1
- data/pages/spec/models/constructor_pages/template_model_spec.rb +1 -1
- data/spec/dummy/config/environment.rb +0 -2
- data/spec/spec_helper.rb +5 -0
- metadata +23 -7
- data/pages/spec/requests/constructor_pages/pages_controller_spec.rb +0 -12
@@ -8,27 +8,23 @@ module ConstructorPages
|
|
8
8
|
Template.delete_all
|
9
9
|
@template = Template.create name: 'Page', code_name: 'page'
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
Field.delete_all
|
12
|
+
Field::TYPES.each do |t|
|
13
|
+
"constructor_pages/types/#{t}_type".classify.constantize.delete_all
|
14
|
+
end
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '.create' do
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
it 'should be valid' do
|
19
|
+
_field = Field.create name: 'Content', code_name: 'content', template: @template, type_value: 'text'
|
20
|
+
_field.should be_valid
|
21
|
+
end
|
22
22
|
|
23
23
|
it 'should create page fields' do
|
24
|
-
|
25
|
-
|
26
|
-
@template.
|
27
|
-
|
28
|
-
#_page.save.should be_true
|
29
|
-
#_page = Page.create name: 'Page'#, template_id: @template.id
|
30
|
-
#_page.template_id.should_not be_nil
|
31
|
-
#_page.price.should == ''
|
24
|
+
_field = Field.create name: 'Price', code_name: 'price', template: @template, type_value: 'text'
|
25
|
+
|
26
|
+
_page = Page.create name: 'Page', template_id: @template.id
|
27
|
+
_page.price.should == ''
|
32
28
|
end
|
33
29
|
end
|
34
30
|
|
@@ -36,8 +36,9 @@ module ConstructorPages
|
|
36
36
|
Page.find_by_request_or_first('/new-page').should == @page
|
37
37
|
end
|
38
38
|
|
39
|
-
it 'should return first page if no given request' do
|
39
|
+
it 'should return first page if no given request or request is home page' do
|
40
40
|
Page.find_by_request_or_first.should == @page
|
41
|
+
Page.find_by_request_or_first('/').should == @page
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,7 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
|
7
7
|
SimpleCov::Formatter::HTMLFormatter,
|
8
8
|
Coveralls::SimpleCov::Formatter
|
9
9
|
]
|
10
|
+
|
10
11
|
SimpleCov.start 'rails'
|
11
12
|
|
12
13
|
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
|
@@ -14,9 +15,13 @@ ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENG
|
|
14
15
|
require File.expand_path("../dummy/config/environment", __FILE__)
|
15
16
|
|
16
17
|
require 'rspec/rails'
|
18
|
+
require 'capybara/rails'
|
17
19
|
require 'capybara/rspec'
|
18
20
|
require 'database_cleaner'
|
19
21
|
|
22
|
+
include Warden::Test::Helpers
|
23
|
+
Warden.test_mode!
|
24
|
+
|
20
25
|
Rails.backtrace_cleaner.remove_silencers!
|
21
26
|
|
22
27
|
Dir[File.join(ENGINE_RAILS_ROOT, 'spec/support/**/*.rb')].each {|f| require f}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: constructor-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Zotov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: constructor-core
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.6.
|
19
|
+
version: 0.6.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.6.
|
26
|
+
version: 0.6.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: constructor-pages
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.6.
|
33
|
+
version: 0.6.2
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.6.
|
40
|
+
version: 0.6.2
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: launchy
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: Constructor – content management system
|
98
112
|
email: ivanzotov@gmail.com
|
99
113
|
executables: []
|
@@ -335,6 +349,7 @@ files:
|
|
335
349
|
- pages/app/helpers/constructor_pages/move_helper.rb
|
336
350
|
- pages/app/helpers/constructor_pages/pages_helper.rb
|
337
351
|
- pages/app/helpers/constructor_pages/templates_helper.rb
|
352
|
+
- pages/app/helpers/constructor_pages/treeview_helper.rb
|
338
353
|
- pages/app/models/constructor_pages/field.rb
|
339
354
|
- pages/app/models/constructor_pages/page.rb
|
340
355
|
- pages/app/models/constructor_pages/template.rb
|
@@ -365,6 +380,7 @@ files:
|
|
365
380
|
- pages/app/views/constructor_pages/pages/index.haml
|
366
381
|
- pages/app/views/constructor_pages/pages/new.haml
|
367
382
|
- pages/app/views/constructor_pages/pages/show.haml
|
383
|
+
- pages/app/views/constructor_pages/partials/_arrow_buttons.haml
|
368
384
|
- pages/app/views/constructor_pages/templates/_form.haml
|
369
385
|
- pages/app/views/constructor_pages/templates/edit.haml
|
370
386
|
- pages/app/views/constructor_pages/templates/index.haml
|
@@ -389,10 +405,10 @@ files:
|
|
389
405
|
- pages/lib/constructor-pages.rb
|
390
406
|
- pages/lib/constructor_pages/engine.rb
|
391
407
|
- pages/public/hello.txt
|
408
|
+
- pages/spec/features/constructor_pages/pages_controller_spec.rb
|
392
409
|
- pages/spec/models/constructor_pages/field_model_spec.rb
|
393
410
|
- pages/spec/models/constructor_pages/page_model_spec.rb
|
394
411
|
- pages/spec/models/constructor_pages/template_model_spec.rb
|
395
|
-
- pages/spec/requests/constructor_pages/pages_controller_spec.rb
|
396
412
|
- spec/dummy/README.rdoc
|
397
413
|
- spec/dummy/Rakefile
|
398
414
|
- spec/dummy/app/assets/javascripts/application.js
|