kuhsaft 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 75909c39662d25ba3f5e234dc0faddeaa9b2052a
4
- data.tar.gz: 5aa4fd67c0873bd503ded0fe1f40d0da5e00a6db
3
+ metadata.gz: ac77e66409517fb5bcb98ff2600257f33637ef2b
4
+ data.tar.gz: 10e4316e5017e8d9729280b4720cdee9a3c38b4a
5
5
  SHA512:
6
- metadata.gz: 9f7fa3ff3063e53e1c828730a21e21c2a9e1425103893ce2d6d1483664b83de7ea7189fa46c61308c3c37ca9d03db2bac5cbd4cd0e13d37c127ee47068598e25
7
- data.tar.gz: 18a94bb44f64518879fe7f1f10df92390a861712f2cb3357061f1328096c3e077c22ba2468611cb42be69b8fe316f27fdb32af80e5f2f5d7fcf270c4b770966e
6
+ metadata.gz: 4be55cad81853d2572bda9f90d43a3864cd1ff88b857e4177fb1e686e341912fd1cfa2f6236d7168968c3a41486ed62be98a481fbc0f50b88e20748b5e99f598
7
+ data.tar.gz: ee3d836f72067c597a0e71e7f20e86c349c3517239ef6dfef4c7106b4a266de3e439982bba7713dcf146c332dc9b4d17a9f1d45b5a647bf57e0f6f2706fc2af5
@@ -1,7 +1,6 @@
1
1
  module Kuhsaft
2
2
  module Cms
3
3
  class AdminController < ActionController::Base
4
- inherit_resources
5
4
  respond_to :html
6
5
  layout 'kuhsaft/cms/application'
7
6
  before_filter :set_content_locale
@@ -33,6 +33,7 @@ module Kuhsaft
33
33
  def edit
34
34
  @page = Kuhsaft::Page.find(params[:id])
35
35
  @page.published ||= Kuhsaft::PublishState::UNPUBLISHED
36
+ @page.bricks.each { |brick| brick.valid? }
36
37
  respond_with @page
37
38
  end
38
39
 
@@ -9,9 +9,9 @@ module Kuhsaft
9
9
 
10
10
  def self.style_for_index(style, idx)
11
11
  [
12
- ['span4', 'span8'],
12
+ ['span8', 'span4'],
13
13
  ['span6', 'span6'],
14
- ['span8', 'span4']
14
+ ['span4', 'span8']
15
15
  ][style][idx]
16
16
  end
17
17
  end
@@ -5,6 +5,8 @@ module Kuhsaft
5
5
  include ActionView::Helpers::SanitizeHelper
6
6
  HTML_ENTITIES = HTMLEntities.new
7
7
 
8
+ validates_presence_of :text
9
+
8
10
  def user_can_add_childs?
9
11
  false
10
12
  end
@@ -15,5 +15,4 @@ module Kuhsaft
15
15
  require 'bootstrap-sass'
16
16
  require 'haml'
17
17
  require 'ckeditor_rails'
18
- require 'inherited_resources'
19
18
  end
@@ -1,3 +1,3 @@
1
1
  module Kuhsaft
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
@@ -75,7 +75,7 @@ describe Kuhsaft::PagesController do
75
75
  expect(response).to redirect_to('/de/redirect_page')
76
76
  end
77
77
 
78
- it 'redirects to root' do
78
+ it 'redirects to root' do
79
79
  page = FactoryGirl.create(:page, :page_type => 'redirect', :slug => 'dumdidum', :url => 'de/dumdidum', :redirect_url => '/')
80
80
  get :show, { :url => page.slug, :use_route => :kuhsaft }
81
81
  expect(response).to redirect_to('/')
@@ -10,6 +10,11 @@ FactoryGirl.define do
10
10
  p.url ''
11
11
  end
12
12
 
13
+ factory :text_brick, :class => 'Kuhsaft::TextBrick' do |tb|
14
+ tb.type 'Kuhsaft::TextBrick'
15
+ tb.text 'DummyText'
16
+ end
17
+
13
18
  factory :asset, :class => Kuhsaft::Asset do |a|
14
19
  a.file File.open("#{Kuhsaft::Engine.root}/spec/dummy/app/assets/images/spec-image.png")
15
20
  end
@@ -62,4 +62,15 @@ describe 'Cms/Pages' do
62
62
  end
63
63
  end
64
64
  end
65
+
66
+ describe '#edit' do
67
+ it 'shows error messages on invalid bricks' do
68
+ @page = FactoryGirl.create(:page)
69
+ invalid_brick = FactoryGirl.build(:text_brick, text: nil, brick_list: @page)
70
+ invalid_brick.save(validate: false)
71
+
72
+ visit kuhsaft.edit_cms_page_path(@page)
73
+ page.should have_css('.error', :count => 1)
74
+ end
75
+ end
65
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuhsaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Immanuel Häussermann
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-10-02 00:00:00.000000000 Z
15
+ date: 2013-10-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -378,20 +378,6 @@ dependencies:
378
378
  - - '>='
379
379
  - !ruby/object:Gem::Version
380
380
  version: '0'
381
- - !ruby/object:Gem::Dependency
382
- name: inherited_resources
383
- requirement: !ruby/object:Gem::Requirement
384
- requirements:
385
- - - '>='
386
- - !ruby/object:Gem::Version
387
- version: '0'
388
- type: :runtime
389
- prerelease: false
390
- version_requirements: !ruby/object:Gem::Requirement
391
- requirements:
392
- - - '>='
393
- - !ruby/object:Gem::Version
394
- version: '0'
395
381
  description: Kuhsaft is a Rails engine that offers a simple CMS.
396
382
  email: developers@screenconcept.ch
397
383
  executables: []
@@ -648,7 +634,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
648
634
  version: '0'
649
635
  requirements: []
650
636
  rubyforge_project: kuhsaft
651
- rubygems_version: 2.0.6
637
+ rubygems_version: 2.0.3
652
638
  signing_key:
653
639
  specification_version: 4
654
640
  summary: A tool that helps you to manage your content within your app.