aslakjo-comatose 2.0.5.2 → 2.0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/comatose.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # Generated on Tue May 20 20:13:12 -0500 2008
2
2
  Gem::Specification.new do |s|
3
3
  s.name = "comatose"
4
- s.version = "2.0.5.2"
4
+ s.version = "2.0.5.3"
5
5
  s.date = "2008-10-31" # 2008-05-20
6
6
  s.summary = "Micro CMS designed for being embedded into existing Rails applications"
7
7
  s.email = "matt@elucidata.net"
data/lib/comatose.rb CHANGED
@@ -9,6 +9,7 @@ module Comatose
9
9
  end
10
10
  end
11
11
 
12
+
12
13
  end
13
14
 
14
15
  require 'acts_as_versioned'
@@ -31,3 +32,14 @@ require 'dispatcher' unless defined?(::Dispatcher)
31
32
  ::Dispatcher.to_prepare :comatose do
32
33
  Comatose.config.after_setup.call
33
34
  end
35
+
36
+ module Comatose
37
+ def self.create_root_page(options ={})
38
+ unless ComatosePage.root
39
+ page = ComatosePage.create({:title=>'root page', :body=>"Welcome to comatose", :author=>'System', :parent_id=>nil}.merge(options))
40
+ page.save(false)
41
+ else
42
+ raise "There exists a comatose root page, cant create another one"
43
+ end
44
+ end
45
+ end
@@ -40,5 +40,4 @@ class ComatoseControllerTest < Test::Unit::TestCase
40
40
  assert_response :success
41
41
  assert_tag :tag=>'title', :child=>/Question/
42
42
  end
43
-
44
43
  end
data/test/test_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  ENV["RAILS_ENV"] = 'test'
2
2
 
3
- require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb'))
3
+ require File.expand_path(File.join(File.dirname(__FILE__), "/../../comatose_harness/config/environment.rb"))
4
4
 
5
5
  require 'test/unit'
6
6
  require 'test_help'
@@ -42,6 +42,8 @@ class Test::Unit::TestCase
42
42
  assert_difference object, method, 0, &block
43
43
  end
44
44
 
45
+
46
+
45
47
  class << self
46
48
  def should(behave,&block)
47
49
  method_name = "test_should_#{behave.gsub(' ', '_')}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aslakjo-comatose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5.2
4
+ version: 2.0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - M@ McCray