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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Guardfile +1 -3
  4. data/constructor-cms.gemspec +1 -0
  5. data/core/app/controllers/constructor_core/users_controller.rb +0 -2
  6. data/core/app/views/constructor_core/sessions/new.html.haml +5 -5
  7. data/core/app/views/constructor_core/users/profile.haml +3 -3
  8. data/core/app/views/layouts/constructor_core/application.haml +12 -12
  9. data/core/config/routes.rb +1 -1
  10. data/core/lib/constructor_core/version.rb +1 -1
  11. data/lib/constructor-cms/engine.rb +1 -1
  12. data/pages/app/controllers/constructor_pages/pages_controller.rb +11 -6
  13. data/pages/app/controllers/constructor_pages/templates_controller.rb +2 -1
  14. data/pages/app/helpers/constructor_pages/move_helper.rb +2 -2
  15. data/pages/app/helpers/constructor_pages/pages_helper.rb +2 -0
  16. data/pages/app/helpers/constructor_pages/templates_helper.rb +2 -0
  17. data/pages/app/helpers/constructor_pages/treeview_helper.rb +33 -0
  18. data/pages/app/models/constructor_pages/page.rb +4 -2
  19. data/pages/app/views/constructor_pages/fields/_form.haml +10 -10
  20. data/pages/app/views/constructor_pages/fields/types/_html.haml +1 -1
  21. data/pages/app/views/constructor_pages/fields/types/_image.haml +1 -1
  22. data/pages/app/views/constructor_pages/fields/types/_integer.haml +1 -1
  23. data/pages/app/views/constructor_pages/fields/types/_string.haml +1 -1
  24. data/pages/app/views/constructor_pages/fields/types/_text.haml +1 -1
  25. data/pages/app/views/constructor_pages/pages/_breadcrumbs.haml +2 -2
  26. data/pages/app/views/constructor_pages/pages/_form.haml +30 -30
  27. data/pages/app/views/constructor_pages/pages/index.haml +35 -45
  28. data/pages/app/views/constructor_pages/partials/_arrow_buttons.haml +6 -0
  29. data/pages/app/views/constructor_pages/templates/_form.haml +23 -18
  30. data/pages/app/views/constructor_pages/templates/index.haml +11 -30
  31. data/pages/config/locales/en.yml +1 -0
  32. data/pages/config/locales/ru.yml +1 -0
  33. data/pages/config/routes.rb +16 -21
  34. data/pages/spec/features/constructor_pages/pages_controller_spec.rb +280 -0
  35. data/pages/spec/models/constructor_pages/field_model_spec.rb +12 -16
  36. data/pages/spec/models/constructor_pages/page_model_spec.rb +2 -1
  37. data/pages/spec/models/constructor_pages/template_model_spec.rb +1 -1
  38. data/spec/dummy/config/environment.rb +0 -2
  39. data/spec/spec_helper.rb +5 -0
  40. metadata +23 -7
  41. 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
- #Field.delete_all
12
- #Field::TYPES.each do |t|
13
- # "constructor_pages/types/#{t}_type".classify.constantize.delete_all
14
- #end
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
- #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
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
- #_field = Field.create name: 'Price', code_name: 'price', template: @template, type_value: 'text'
25
-
26
- @template.should_not be_nil
27
- Page.new name: 'hello world'#, template: @template
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
 
@@ -20,7 +20,7 @@ module ConstructorPages
20
20
  _brand.reload
21
21
 
22
22
  _brand.child.should == _series
23
- _brand.child_id = 1
23
+ _brand.child_id = _brand.id
24
24
 
25
25
  _brand.child.should == _brand
26
26
  end
@@ -1,7 +1,5 @@
1
1
  # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- ::ActiveSupport::Deprecation.silenced = true
5
-
6
4
  # Initialize the Rails application.
7
5
  Dummy::Application.initialize!
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.1
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-19 00:00:00.000000000 Z
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.1
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.1
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.1
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.1
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
@@ -1,12 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
4
-
5
- module ConstructorPages
6
- describe 'Page Controller', type: :feature do
7
- # it 'should be valid' do
8
- # Page.create name: 'Hello'
9
- # visit '/hello'
10
- # end
11
- end
12
- end