noodall 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,16 @@ module Noodall
22
22
  copy_file "config/cucumber.yml"
23
23
  end
24
24
 
25
+ def lib
26
+ super
27
+ copy_file "lib/tasks/populate.rake"
28
+ end
29
+
30
+ def config
31
+ super
32
+ copy_file "config/sitemap.yml"
33
+ end
34
+
25
35
  end
26
36
 
27
37
  class AppGenerator < Rails::Generators::AppGenerator
@@ -1,23 +1,31 @@
1
1
  source 'http://rubygems.org'
2
+ source 'http://gems.github.com'
2
3
 
3
4
  gem 'rails', '3.0.3'
4
- gem 'noodall-ui'
5
+ gem 'mm-multi-parameter-attributes', :git => 'git://github.com/kernow/mm-multi-parameter-attributes.git'
6
+ gem 'noodall-ui', '~> 0.1.9'
5
7
  gem 'noodall-devise'
6
- gem 'bson_ext', '~> 1.0.9'
8
+ gem 'bson_ext', '~> 1.2.0'
7
9
  gem 'rmagick', :require => 'RMagick'
8
- gem 'dragonfly', '~> 0.7.6'
10
+ gem 'dragonfly', '~> 0.8.1'
11
+ gem 'factory_girl_rails'
12
+ gem 'fakerama'
9
13
 
14
+ group :production, :staging do
15
+ gem 'dalli'
16
+ gem 'rack-cache', '~> 1.0.0', :require => 'rack/cache'
17
+ gem 'rack-contrib', :require => 'rack/contrib'
18
+ end
10
19
 
11
20
  group :development, :test do
12
21
  gem 'capybara'
13
22
  gem 'database_cleaner'
14
23
  gem 'cucumber-rails'
15
24
  gem 'cucumber'
16
- gem 'rspec-rails', "~> 2.0.0.beta.22"
25
+ gem 'rspec-rails', "~> 2.0.0"
17
26
  gem 'spork'
18
27
  gem 'launchy' # So you can do Then show me the page
19
- gem 'jeweler', '~> 1.4.0'
20
28
  gem 'factory_girl_rails'
21
- gem "faker", "~> 0.3.1"
22
29
  gem "haml"
23
30
  end
31
+
@@ -11,6 +11,11 @@
11
11
  <%%= csrf_meta_tag %>
12
12
  </head>
13
13
  <body>
14
+ <%%= form_tag(noodall_search_path, :method => :get, :class => 'search') do %>
15
+ <%%= text_field_tag :q, params[:q] || 'Enter keyword(s) here' %>
16
+ <%%= submit_tag 'Search' %>
17
+ <%% end %>
18
+
14
19
  <%%= flash_messages %>
15
20
 
16
21
  <%%= yield %>
@@ -1,3 +1,11 @@
1
+ # Use Noodall's default dragonfly setup for assets
1
2
  require 'noodall/dragonfly'
2
- Noodall::Node.slots :main, :wide, :small
3
+
4
+ # Set the slots that are avaiable to put components in
5
+ Noodall::Node.slots :main, :large, :small
6
+
7
+ # Set the mongo collection name for nodes
3
8
  Noodall::Node.set_collection_name 'nodes'
9
+
10
+ # Reset global update time on startup
11
+ Noodall::GlobalUpdateTime::Stamp.update!
@@ -1,5 +1,6 @@
1
1
  <%= app_const %>.routes.draw do
2
2
  devise_for :users
3
+ get 'admin' => 'noodall/admin/nodes#index', :as => 'admin_root'
3
4
  namespace :admin do
4
5
  resources :users
5
6
  end
@@ -0,0 +1,24 @@
1
+ home:
2
+ title: Welcome
3
+ type: Home
4
+ #about:
5
+ # title: About Us
6
+ # type: ContentPage
7
+ # children:
8
+ # 1st Service:
9
+ # type: content_page
10
+ # 2nd Service:
11
+ # type: content_page
12
+ # children:
13
+ # Subber:
14
+ # type: content_page
15
+ #contact-us:
16
+ # title: Contact Us
17
+ # type: ContentPage
18
+ #privacy-policy:
19
+ # title: Privacy Policy
20
+ # type: ContentPage
21
+ #terms-conditions:
22
+ # title: Terms Conditions
23
+ # type: ContentPage
24
+
@@ -6,5 +6,6 @@
6
6
  # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
7
  # Mayor.create(:name => 'Daley', :city => cities.first)
8
8
  #
9
- User.create!(:name => "Mr Admin", :email => "hello@wearebeef.co.uk", :password => "passw0rd", :password_confirmation => "passw0rd", :groups => ['admin'])
10
- Home.create!(:title => "Home", :publish => true, :body => "Welcome")
9
+ Noodall::Node.create_indexes!
10
+ Noodall::Site.build!
11
+ User.create(:name => "Mr Admin", :email => "hello@wearebeef.co.uk", :password => "passw0rd", :password_confirmation => "passw0rd", :groups => ['admin'])
@@ -1,15 +1,38 @@
1
+ # http://www.pivotaltracker.com/story/show/8969343
1
2
  Feature: Component Slots
2
3
  In order that web site editors can add functionality and information to content they will be able to fill slots with components
3
4
 
5
+ Background:
6
+ Given I am signed in as a website editor
7
+
4
8
  Scenario Outline: Component Slots
5
9
  Given a <Template Name> exists
6
- And I am signed in as a website editor
7
10
  When I am editing the <Template Name>
8
- Then I should be able to place components in <Hero Slots Per Page> hero slots
9
- And I should be able to place components in <Wide Slots Per Page> wide slots
10
- And I should be able to place components in <Small Slots Per Page> small slots
11
+ Then I should be able to place components in <Hero> hero slots
12
+ And I should be able to place components in <Large> large slots
13
+ And I should be able to place components in <Small> small slots
14
+ And I should be able to place components in <Call> call slots
15
+ And I should be able to place components in <Promo> promo slots
16
+
17
+ Examples:
18
+ | Template Name | Hero | Large | Small | Call | Promo |
19
+ | Home | 1 | 0 | 2 | 4 | 4 |
20
+ | Landing Page | 1 | 0 | 10 | 0 | 0 |
21
+ | Content Page | 0 | 3 | 10 | 0 | 0 |
22
+ | Sign Up Form | 0 | 0 | 0 | 0 | 0 |
23
+ | Article List | 0 | 0 | 5 | 0 | 0 |
24
+ | Article | 0 | 3 | 5 | 0 | 0 |
25
+
26
+ @javascript
27
+ Scenario Outline: Available Slots
28
+ Given I am placing a component in a <Slot Name> slot
29
+ Then I should be able choose from the components <Avaiable Components>
11
30
 
12
31
  Examples:
13
- | Template Name | Hero Slots Per Page | Wide Slots Per Page | Small Slots Per Page |
14
- | home | 0 | 0 | 4 |
32
+ | Slot Name | Avaiable Components |
33
+ | Hero | Carousel |
34
+ | Large | Call To Action, General Content, Quote, Gallery, Logo Ticker, Twitter, Latest Articles, Asset Download |
35
+ | Small | Call To Action, Call To Action Image, General Content, Quote, Gallery, Logo Ticker, Twitter, Latest Articles, Asset Download |
36
+ | Call | Call To Action, Call To Action Image |
37
+ | Promo | General Content |
15
38
 
@@ -1,3 +1,4 @@
1
+ # http://www.pivotaltracker.com/story/show/8969347
1
2
  Feature: Content Templates
2
3
  In order to change how the content looks and acts on the website a website editor will be able to select from predetermined templates
3
4
 
@@ -9,14 +10,18 @@ Feature: Content Templates
9
10
  Then I should be able select a template from the following:
10
11
  | Template |
11
12
  | Landing Page |
13
+ | Article List |
12
14
 
13
15
  Scenario Outline: Create Child Content
14
16
  Given I create a new child under a <Parent Template Name>
15
17
  Then I should be able select a template from "<Allowed Templates>"
16
18
 
17
19
  Examples:
18
- | Parent Template Name | Allowed Templates |
19
- | Home | Content Page |
20
- #| Content Page | Content Page, Event Page |
21
- #| Event Page | Content Page |
20
+ | Parent Template Name | Allowed Templates |
21
+ | Home | none |
22
+ | Landing Page | Landing Page, Content Page, Sign Up Form, Article List |
23
+ | Content Page | Landing Page, Content Page, Sign Up Form |
24
+ | Sign Up Form | Content Page |
25
+ | Article List | Article |
26
+ | Article | none |
22
27
 
@@ -18,7 +18,11 @@ When /^I am editing the (.*)$/ do |model|
18
18
  end
19
19
 
20
20
  Then /^I should be able to place components in (\d+) (.*) slots$/ do |number, slot_type|
21
- page.should have_css("#slot-list .#{slot_type}-slot", :count => number.to_i)
21
+ if number.to_i == 0
22
+ page.should_not have_css("#slot-list .#{slot_type}-slot")
23
+ else
24
+ page.should have_css("#slot-list .#{slot_type}-slot", :count => number.to_i)
25
+ end
22
26
  end
23
27
 
24
28
  When /^I create a new root$/ do
@@ -30,8 +34,7 @@ When /^I create a new child under a (.*)$/ do |template_title|
30
34
  #create the ancester
31
35
  parent = Factory(template.to_sym)
32
36
 
33
- visit noodall_admin_node_nodes_path(parent)
34
- click_link 'New'
37
+ visit new_noodall_admin_node_node_path(parent)
35
38
  end
36
39
 
37
40
 
@@ -42,8 +45,12 @@ Then /^I should be able select a template from the following:$/ do |table|
42
45
  end
43
46
 
44
47
  Then /^I should be able select a template from "([^\"]*)"$/ do |templates|
45
- templates.split(',').map(&:strip).each do |template|
46
- choose(template)
48
+ if templates == 'none'
49
+ page.should_not have_css('.template input')
50
+ else
51
+ templates.split(',').map(&:strip).each do |template|
52
+ choose(template)
53
+ end
47
54
  end
48
55
  end
49
56
 
@@ -82,3 +89,13 @@ Given /^each child has (\d+) children$/ do |count|
82
89
  end
83
90
  end
84
91
  end
92
+
93
+ Given /^the (.*) titled "([^"]*)" has the following children:$/ do |template, title, table|
94
+ @_content = dehumanize(template).find_by_title(title)
95
+ table.map_headers! {|header| header.parameterize('_').to_sym }
96
+ table.hashes.each do |attributes|
97
+ factory_type = attributes.delete(:type).parameterize('_')
98
+ Factory(factory_type, attributes.merge(:parent => @_content, :publish => true))
99
+ end
100
+ end
101
+
@@ -19,6 +19,27 @@ When /^(?:|I )fill in the following within the component:$/ do |fields|
19
19
  end
20
20
  end
21
21
 
22
+ Given /^I am placing a component in a (.*) slot$/ do |slot|
23
+ begin
24
+ Home.send("#{slot.downcase}_slots", 1)
25
+ rescue Exception => e
26
+ # Hides validation errors if the slot already exists
27
+ end
28
+
29
+ node = Home.create!(:title => "Test Node")
30
+
31
+ visit noodall_admin_node_path(node)
32
+ within('ol#slot-list') do
33
+ click_link "#{slot} Slot"
34
+ end
35
+ end
36
+
37
+ Then /^I should be able choose from the components (.*)$/ do |components|
38
+ components.split(',').map(&:strip).each do |component|
39
+ Then %{I select the "#{component}" component}
40
+ end
41
+ end
42
+
22
43
  Then /^I add some images from the asset library$/ do
23
44
  5.times do |i|
24
45
  Factory(:asset, :title => "Image #{i}")
@@ -30,18 +51,51 @@ Then /^I add some images from the asset library$/ do
30
51
  end
31
52
  end
32
53
  page.find(:css, 'li.action a').click
54
+ sleep 2
55
+ end
56
+
57
+ Then /^I add some assets to from the asset library$/ do
58
+ 2.times do |i|
59
+ Factory(:txt_asset, :title => "Text Asset #{i}")
60
+ end
61
+ 3.times do |i|
62
+ Factory(:zip_asset, :title => "Zip Asset #{i}")
63
+ end
64
+ page.find(:css, 'span.add-multi-asset').click
65
+ sleep 1
66
+ within "#asset-browser" do
67
+ within "#browser-list li[title='Text Asset 0']" do
68
+ click_link "Add"
69
+ end
70
+ within "#browser-list li[title='Zip Asset 1']" do
71
+ click_link "Add"
72
+ end
73
+ within "#browser-list li[title='Zip Asset 2']" do
74
+ click_link "Add"
75
+ end
76
+ end
77
+ page.find(:css, 'li.action a').click
78
+ sleep 2
79
+ end
80
+
81
+ Then /^should see a list of the files I selected$/ do
82
+ page.should have_css(".downloads li a", :count => 3)
83
+ page.should have_css(".downloads li a[href$='.txt']", :count => 1)
84
+ page.should have_css(".downloads li a[href$='.zip']", :count => 2)
33
85
  end
34
86
 
87
+
35
88
  When /^(?:|I )press "([^"]*)" within the component$/ do |button|
36
89
  within "#fancybox-inner" do
37
90
  click_button(button)
38
91
  end
39
- sleep 1
92
+ sleep 2
40
93
  end
41
94
 
42
95
  When /^(?:|I )select an image from the asset library$/ do
43
96
  asset = Factory(:asset, :title => "My Image")
44
97
  page.find(:css, 'span.select-file').click
98
+ sleep 1
45
99
  click_link "Add"
46
100
  sleep 5
47
101
  end
@@ -0,0 +1,10 @@
1
+ namespace :db do
2
+
3
+ task :seed => :environment do
4
+ require 'db/seeds'
5
+ end
6
+
7
+ task :populate => :seed do
8
+ # Create some sub pages
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Noodall
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: noodall
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease: false
4
+ hash: 21
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors: []
13
13
 
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-10 00:00:00 +00:00
18
+ date: 2011-02-16 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -125,6 +125,7 @@ files:
125
125
  - lib/noodall/templates/config/locales/devise.en.yml
126
126
  - lib/noodall/templates/config/locales/en.yml
127
127
  - lib/noodall/templates/config/routes.rb
128
+ - lib/noodall/templates/config/sitemap.yml
128
129
  - lib/noodall/templates/db/seeds.rb
129
130
  - lib/noodall/templates/doc/README_FOR_APP
130
131
  - lib/noodall/templates/features/component_slots.feature
@@ -137,6 +138,7 @@ files:
137
138
  - lib/noodall/templates/features/support/home_page.rb
138
139
  - lib/noodall/templates/features/support/paths.rb
139
140
  - lib/noodall/templates/gitignore
141
+ - lib/noodall/templates/lib/tasks/populate.rake
140
142
  - lib/noodall/templates/public/404.html
141
143
  - lib/noodall/templates/public/422.html
142
144
  - lib/noodall/templates/public/500.html
@@ -190,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
192
  requirements: []
191
193
 
192
194
  rubyforge_project:
193
- rubygems_version: 1.3.7
195
+ rubygems_version: 1.4.1
194
196
  signing_key:
195
197
  specification_version: 3
196
198
  summary: Noodall meta-gem that depends on the other components