navi 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +41 -0
- data/Gemfile.lock +196 -0
- data/Guardfile +23 -0
- data/LICENSE.txt +20 -0
- data/README.textile +26 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/features/create_menu_items.feature +13 -0
- data/features/step_definitions/category_steps.rb +3 -0
- data/features/step_definitions/menu_item_steps.rb +19 -0
- data/features/step_definitions/page_steps.rb +3 -0
- data/features/step_definitions/web_steps.rb +211 -0
- data/features/support/env.rb +61 -0
- data/features/support/paths.rb +33 -0
- data/features/support/selectors.rb +39 -0
- data/lib/navi/helpers.rb +24 -0
- data/lib/navi/navigable/base.rb +16 -0
- data/lib/navi/navigable/instance_methods.rb +24 -0
- data/lib/navi/navigator/.base.rb.swo +0 -0
- data/lib/navi/navigator/base.rb +11 -0
- data/lib/navi/navigator/class_methods.rb +27 -0
- data/lib/navi/navigator/instance_methods.rb +57 -0
- data/lib/navi/railtie.rb +11 -0
- data/lib/navi/renderers/base.rb +31 -0
- data/lib/navi/renderers/simple_navigation.rb +30 -0
- data/lib/navi.rb +29 -0
- data/navi.gemspec +281 -0
- data/spec/blueprints.rb +16 -0
- data/spec/dummy/.gitignore +6 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/categories_controller.rb +7 -0
- data/spec/dummy/app/controllers/menu_items_controller.rb +15 -0
- data/spec/dummy/app/controllers/pages_controller.rb +7 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/category.rb +3 -0
- data/spec/dummy/app/models/menu_item.rb +2 -0
- data/spec/dummy/app/models/page.rb +3 -0
- data/spec/dummy/app/views/categories/_form.html.haml +2 -0
- data/spec/dummy/app/views/categories/edit.html.haml +5 -0
- data/spec/dummy/app/views/categories/index.html.haml +17 -0
- data/spec/dummy/app/views/categories/new.html.haml +5 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/menu_items/edit.html.haml +14 -0
- data/spec/dummy/app/views/menu_items/index.html.haml +11 -0
- data/spec/dummy/app/views/pages/_form.html.haml +2 -0
- data/spec/dummy/app/views/pages/edit.html.haml +5 -0
- data/spec/dummy/app/views/pages/index.html.haml +17 -0
- data/spec/dummy/app/views/pages/new.html.haml +5 -0
- data/spec/dummy/app/widgets/menu_editor/category/form/.display.html.haml.swo +0 -0
- data/spec/dummy/app/widgets/menu_editor/category/form/display.html.haml +7 -0
- data/spec/dummy/app/widgets/menu_editor/category/form_widget.rb +18 -0
- data/spec/dummy/app/widgets/menu_editor/display.html.haml +5 -0
- data/spec/dummy/app/widgets/menu_editor/page/form/.display.html.haml.swo +0 -0
- data/spec/dummy/app/widgets/menu_editor/page/form/display.html.haml +8 -0
- data/spec/dummy/app/widgets/menu_editor/page/form_widget.rb +18 -0
- data/spec/dummy/app/widgets/menu_editor/tree/display.html.haml +4 -0
- data/spec/dummy/app/widgets/menu_editor/tree/item.html.haml +7 -0
- data/spec/dummy/app/widgets/menu_editor/tree/items.html.haml +2 -0
- data/spec/dummy/app/widgets/menu_editor/tree_widget.rb +48 -0
- data/spec/dummy/app/widgets/menu_editor_widget.rb +11 -0
- data/spec/dummy/config/application.rb +45 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/cucumber.yml +8 -0
- data/spec/dummy/config/database.yml +19 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +26 -0
- data/spec/dummy/config/environments/production.rb +49 -0
- data/spec/dummy/config/environments/test.rb +35 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +10 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/navigable.rb +1 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/navigation.rb +7 -0
- data/spec/dummy/config/routes.rb +61 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/20110607155019_create_menu_items.rb +20 -0
- data/spec/dummy/db/migrate/20110607155202_create_categories.rb +13 -0
- data/spec/dummy/db/migrate/20110607160052_create_pages.rb +13 -0
- data/spec/dummy/db/schema.rb +41 -0
- data/spec/dummy/db/seeds.rb +15 -0
- data/spec/dummy/lib/tasks/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/cucumber.rake +57 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +26 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/images/rails.png +0 -0
- data/spec/dummy/public/index.html +239 -0
- data/spec/dummy/public/javascripts/application.js +2 -0
- data/spec/dummy/public/javascripts/jquery-ui.js +11603 -0
- data/spec/dummy/public/javascripts/jquery-ui.min.js +406 -0
- data/spec/dummy/public/javascripts/jquery.js +8936 -0
- data/spec/dummy/public/javascripts/jquery.min.js +18 -0
- data/spec/dummy/public/javascripts/jquery_ujs.js +315 -0
- data/spec/dummy/public/javascripts/menu_items/index.js +40 -0
- data/spec/dummy/public/javascripts/rails.js +315 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/spec/dummy/script/cucumber +10 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/vendor/plugins/.gitkeep +0 -0
- data/spec/navi/helpers_spec.rb +5 -0
- data/spec/navi/navi_spec.rb +76 -0
- data/spec/navi/navigator_spec.rb +204 -0
- data/spec/navi/renderers/simple_navigation_spec.rb +49 -0
- data/spec/spec_helper.rb +125 -0
- metadata +683 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "active_model/railtie"
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
|
9
|
+
Bundler.require
|
10
|
+
require "navi"
|
11
|
+
|
12
|
+
module Dummy
|
13
|
+
class Application < Rails::Application
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
|
18
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
19
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
20
|
+
|
21
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
22
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
23
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
24
|
+
|
25
|
+
# Activate observers that should always be running.
|
26
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
27
|
+
|
28
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
29
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
30
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
31
|
+
|
32
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
33
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
|
+
# config.i18n.default_locale = :de
|
35
|
+
|
36
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
37
|
+
config.action_view.javascript_expansions[:defaults] = %w(jquery jquery-ui.js rails nestedSortable/jquery.ui.nestedSortable.js)
|
38
|
+
|
39
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
+
config.encoding = "utf-8"
|
41
|
+
|
42
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
+
config.filter_parameters += [:password]
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: "db/development.sql"
|
6
|
+
|
7
|
+
# Warning: The database defined as "test" will be erased and
|
8
|
+
# re-generated from your development database when you run "rake".
|
9
|
+
# Do not set this db to the same as development or production.
|
10
|
+
test: &test
|
11
|
+
adapter: sqlite3
|
12
|
+
database: "db/test.sql"
|
13
|
+
|
14
|
+
production:
|
15
|
+
adapter: sqlite3
|
16
|
+
database: "db/production.sql"
|
17
|
+
|
18
|
+
cucumber:
|
19
|
+
<<: *test
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
18
|
+
# If you have no front-end server that supports something like X-Sendfile,
|
19
|
+
# just comment this out and Rails will serve the files
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
|
43
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
44
|
+
# the I18n.default_locale when a translation can not be found)
|
45
|
+
config.i18n.fallbacks = true
|
46
|
+
|
47
|
+
# Send deprecation notices to registered listeners
|
48
|
+
config.active_support.deprecation = :notify
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1 @@
|
|
1
|
+
Navi.navigator = :menu_item
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
Dummy::Application.config.secret_token = '0b31363e8ac2f3bd2717e057333527e99c428dd8d0cfb67788d8adb3e648faf8afe113911ad6a7ca34fd8519df8030193d2b253a09d0300cdf2fb9f83bdd5c74'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,61 @@
|
|
1
|
+
Dummy::Application.routes.draw do
|
2
|
+
resources :menu_items
|
3
|
+
resources :pages
|
4
|
+
resources :categories
|
5
|
+
# The priority is based upon order of creation:
|
6
|
+
# first created -> highest priority.
|
7
|
+
|
8
|
+
# Sample of regular route:
|
9
|
+
# match 'products/:id' => 'catalog#view'
|
10
|
+
# Keep in mind you can assign values other than :controller and :action
|
11
|
+
|
12
|
+
# Sample of named route:
|
13
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
14
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
15
|
+
|
16
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
17
|
+
# resources :products
|
18
|
+
|
19
|
+
# Sample resource route with options:
|
20
|
+
# resources :products do
|
21
|
+
# member do
|
22
|
+
# get 'short'
|
23
|
+
# post 'toggle'
|
24
|
+
# end
|
25
|
+
#
|
26
|
+
# collection do
|
27
|
+
# get 'sold'
|
28
|
+
# end
|
29
|
+
# end
|
30
|
+
|
31
|
+
# Sample resource route with sub-resources:
|
32
|
+
# resources :products do
|
33
|
+
# resources :comments, :sales
|
34
|
+
# resource :seller
|
35
|
+
# end
|
36
|
+
|
37
|
+
# Sample resource route with more complex sub-resources
|
38
|
+
# resources :products do
|
39
|
+
# resources :comments
|
40
|
+
# resources :sales do
|
41
|
+
# get 'recent', :on => :collection
|
42
|
+
# end
|
43
|
+
# end
|
44
|
+
|
45
|
+
# Sample resource route within a namespace:
|
46
|
+
# namespace :admin do
|
47
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
48
|
+
# # (app/controllers/admin/products_controller.rb)
|
49
|
+
# resources :products
|
50
|
+
# end
|
51
|
+
|
52
|
+
# You can have the root of your site routed with "root"
|
53
|
+
# just remember to delete public/index.html.
|
54
|
+
# root :to => "welcome#index"
|
55
|
+
|
56
|
+
# See how all your routes lay out with "rake routes"
|
57
|
+
|
58
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
59
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
60
|
+
# match ':controller(/:action(/:id(.:format)))'
|
61
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateMenuItems < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table(:menu_items) do |t|
|
4
|
+
t.string :label
|
5
|
+
t.string :link
|
6
|
+
t.string :title
|
7
|
+
t.integer :parent_id, :default => 0
|
8
|
+
t.integer :position
|
9
|
+
t.string :highlights_on
|
10
|
+
t.integer :navigable_id
|
11
|
+
t.string :navigable_type
|
12
|
+
t.integer :site_id
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
drop_table(:menu_items)
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead
|
2
|
+
# of editing this file, please use the migrations feature of Active Record to
|
3
|
+
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your
|
6
|
+
# database schema. If you need to create the application database on another
|
7
|
+
# system, you should be using db:schema:load, not running all the migrations
|
8
|
+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
+
#
|
11
|
+
# It's strongly recommended to check this file into your version control system.
|
12
|
+
|
13
|
+
ActiveRecord::Schema.define(:version => 20110607160052) do
|
14
|
+
|
15
|
+
create_table "categories", :force => true do |t|
|
16
|
+
t.string "name"
|
17
|
+
t.string "nombre"
|
18
|
+
t.datetime "created_at"
|
19
|
+
t.datetime "updated_at"
|
20
|
+
end
|
21
|
+
|
22
|
+
create_table "menu_items", :force => true do |t|
|
23
|
+
t.string "label"
|
24
|
+
t.string "link"
|
25
|
+
t.string "title"
|
26
|
+
t.integer "parent_id", :default => 0
|
27
|
+
t.integer "position"
|
28
|
+
t.string "highlights_on"
|
29
|
+
t.integer "navigable_id"
|
30
|
+
t.string "navigable_type"
|
31
|
+
t.datetime "created_at"
|
32
|
+
t.datetime "updated_at"
|
33
|
+
end
|
34
|
+
|
35
|
+
create_table "pages", :force => true do |t|
|
36
|
+
t.string "name"
|
37
|
+
t.datetime "created_at"
|
38
|
+
t.datetime "updated_at"
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
+
#
|
4
|
+
# Examples:
|
5
|
+
#
|
6
|
+
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
+
# Mayor.create(:name => 'Daley', :city => cities.first)
|
8
|
+
|
9
|
+
require '../../spec/blueprints'
|
10
|
+
|
11
|
+
Page.make :name => "Home"
|
12
|
+
Page.make :name => "About"
|
13
|
+
|
14
|
+
Category.make :name => "Cars"
|
15
|
+
Category.make :name => "Animals"
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
|
2
|
+
# It is recommended to regenerate this file in the future when you upgrade to a
|
3
|
+
# newer version of cucumber-rails. Consider adding your own code to a new file
|
4
|
+
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
|
5
|
+
# files.
|
6
|
+
|
7
|
+
|
8
|
+
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
|
9
|
+
|
10
|
+
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first
|
11
|
+
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil?
|
12
|
+
|
13
|
+
begin
|
14
|
+
require 'cucumber/rake/task'
|
15
|
+
|
16
|
+
namespace :cucumber do
|
17
|
+
Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t|
|
18
|
+
t.binary = vendored_cucumber_bin # If nil, the gem's binary is used.
|
19
|
+
t.fork = true # You may get faster startup if you set this to false
|
20
|
+
t.profile = 'default'
|
21
|
+
end
|
22
|
+
|
23
|
+
Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t|
|
24
|
+
t.binary = vendored_cucumber_bin
|
25
|
+
t.fork = true # You may get faster startup if you set this to false
|
26
|
+
t.profile = 'wip'
|
27
|
+
end
|
28
|
+
|
29
|
+
Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t|
|
30
|
+
t.binary = vendored_cucumber_bin
|
31
|
+
t.fork = true # You may get faster startup if you set this to false
|
32
|
+
t.profile = 'rerun'
|
33
|
+
end
|
34
|
+
|
35
|
+
desc 'Run all features'
|
36
|
+
task :all => [:ok, :wip]
|
37
|
+
end
|
38
|
+
desc 'Alias for cucumber:ok'
|
39
|
+
task :cucumber => 'cucumber:ok'
|
40
|
+
|
41
|
+
task :default => :cucumber
|
42
|
+
|
43
|
+
task :features => :cucumber do
|
44
|
+
STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***"
|
45
|
+
end
|
46
|
+
|
47
|
+
# In case we don't have ActiveRecord, append a no-op task that we can depend upon.
|
48
|
+
task 'db:test:prepare' do
|
49
|
+
end
|
50
|
+
rescue LoadError
|
51
|
+
desc 'cucumber rake task not available (cucumber not installed)'
|
52
|
+
task :cucumber do
|
53
|
+
abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
<p>We've been notified about this issue and we'll take a look at it shortly.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
File without changes
|
Binary file
|