diff --git a/Gemfile b/Gemfile index 651c692..4f5298c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,17 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' -gem 'rails', '3.0.4' +gem 'rails', '3.2.0.rc2' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' +# Gems used only for assets and not required +# in production environments by default. +group :assets do + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' +end + platforms :ruby do gem 'sqlite3-ruby', :require => 'sqlite3' end @@ -25,14 +32,14 @@ end # gem 'ruby-debug' # Bundle the extra gems: -gem 'RedCloth', '~> 4.2.7', :require => 'redcloth' +gem 'RedCloth', '~> 4.2.9', :require => 'redcloth' gem 'ruby-openid', :require => 'openid' gem 'rack-openid', :require => 'rack/openid' gem 'aaronh-chronic', :require => 'chronic' # Fixes for 1.9.2 gem 'coderay' gem 'lesstile' gem 'formtastic' -gem 'will_paginate', '= 3.0.pre2' +gem 'will_paginate', '~> 3.0.2' # Bundle gems for the local environment. Make sure to # put test-only gems in this group so their generators diff --git a/Gemfile.lock b/Gemfile.lock index b08c9f0..35b2584 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,143 +1,192 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - RedCloth (4.2.8) + RedCloth (4.2.9) + RedCloth (4.2.9-java) aaronh-chronic (0.3.9) - abstract (1.0.0) - actionmailer (3.0.4) - actionpack (= 3.0.4) - mail (~> 2.2.15) - actionpack (3.0.4) - activemodel (= 3.0.4) - activesupport (= 3.0.4) - builder (~> 2.1.2) - erubis (~> 2.6.6) - i18n (~> 0.4) - rack (~> 1.2.1) - rack-mount (~> 0.6.13) - rack-test (~> 0.5.7) - tzinfo (~> 0.3.23) - activemodel (3.0.4) - activesupport (= 3.0.4) - builder (~> 2.1.2) - i18n (~> 0.4) - activerecord (3.0.4) - activemodel (= 3.0.4) - activesupport (= 3.0.4) - arel (~> 2.0.2) - tzinfo (~> 0.3.23) - activerecord-jdbc-adapter (1.2.0) - activerecord-jdbcsqlite3-adapter (1.2.0) - activerecord-jdbc-adapter (~> 1.2.0) + actionmailer (3.2.0.rc2) + actionpack (= 3.2.0.rc2) + mail (~> 2.3.0) + actionpack (3.2.0.rc2) + activemodel (= 3.2.0.rc2) + activesupport (= 3.2.0.rc2) + builder (~> 3.0.0) + erubis (~> 2.7.0) + journey (~> 1.0.0.rc1) + rack (~> 1.4.0) + rack-cache (~> 1.1) + rack-test (~> 0.6.1) + sprockets (~> 2.1.2) + activemodel (3.2.0.rc2) + activesupport (= 3.2.0.rc2) + builder (~> 3.0.0) + activerecord (3.2.0.rc2) + activemodel (= 3.2.0.rc2) + activesupport (= 3.2.0.rc2) + arel (~> 3.0.0.rc1) + tzinfo (~> 0.3.29) + activerecord-jdbc-adapter (1.2.1) + activerecord-jdbcsqlite3-adapter (1.2.1) + activerecord-jdbc-adapter (~> 1.2.1) jdbc-sqlite3 (~> 3.7.2) - activeresource (3.0.4) - activemodel (= 3.0.4) - activesupport (= 3.0.4) - activesupport (3.0.4) - arel (2.0.8) + activeresource (3.2.0.rc2) + activemodel (= 3.2.0.rc2) + activesupport (= 3.2.0.rc2) + activesupport (3.2.0.rc2) + i18n (~> 0.6) + multi_json (~> 1.0) + arel (3.0.0) bouncy-castle-java (1.5.0146.1) - builder (2.1.2) - coderay (0.9.7) - cucumber (0.10.0) + builder (3.0.0) + capybara (1.1.2) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (~> 2.0) + xpath (~> 0.1.4) + childprocess (0.3.0) + ffi (~> 1.0.6) + coderay (1.0.5) + coffee-rails (3.2.1) + coffee-script (>= 2.2.0) + railties (~> 3.2.0.beta) + coffee-script (2.2.0) + coffee-script-source + execjs + coffee-script-source (1.2.0) + cucumber (1.1.4) builder (>= 2.1.2) - diff-lcs (~> 1.1.2) - gherkin (~> 2.3.2) - json (~> 1.4.6) - term-ansicolor (~> 1.0.5) - cucumber-rails (0.3.2) - cucumber (>= 0.8.0) - diff-lcs (1.1.2) - erubis (2.6.6) - abstract (>= 1.0.0) - factory_girl (1.3.3) - formtastic (1.2.3) - actionpack (>= 2.3.7) - activesupport (>= 2.3.7) - i18n (~> 0.4) - gherkin (2.3.3) - json (~> 1.4.6) - gherkin (2.3.3-java) - json (~> 1.4.6) - i18n (0.5.0) + diff-lcs (>= 1.1.2) + gherkin (~> 2.7.1) + json (>= 1.4.6) + term-ansicolor (>= 1.0.6) + cucumber-rails (1.2.1) + capybara (>= 1.1.2) + cucumber (>= 1.1.3) + nokogiri (>= 1.5.0) + diff-lcs (1.1.3) + erubis (2.7.0) + execjs (1.3.0) + multi_json (~> 1.0) + factory_girl (2.4.2) + activesupport + ffi (1.0.11) + ffi (1.0.11-java) + formtastic (2.0.2) + rails (~> 3.0) + gherkin (2.7.3) + json (>= 1.4.6) + gherkin (2.7.3-java) + json (>= 1.4.6) + hike (1.2.1) + i18n (0.6.0) jdbc-sqlite3 (3.7.2) + journey (1.0.0) jruby-openssl (0.7.4) bouncy-castle-java - jruby-rack (1.0.10) - json (1.4.6) - json (1.4.6-java) + jruby-rack (1.1.3) + json (1.6.5) + json (1.6.5-java) lesstile (1.0.1) - mail (2.2.15) - activesupport (>= 2.3.6) + mail (2.3.0) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.16) + mime-types (1.17.2) + multi_json (1.0.4) nokogiri (1.5.0) nokogiri (1.5.0-java) - polyglot (0.3.1) - rack (1.2.1) - rack-mount (0.6.13) - rack (>= 1.0.0) - rack-openid (1.2.0) + polyglot (0.3.3) + rack (1.4.0) + rack-cache (1.1) + rack (>= 0.4) + rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-test (0.5.7) + rack-ssl (1.3.2) + rack + rack-test (0.6.1) rack (>= 1.0) - rails (3.0.4) - actionmailer (= 3.0.4) - actionpack (= 3.0.4) - activerecord (= 3.0.4) - activeresource (= 3.0.4) - activesupport (= 3.0.4) + rails (3.2.0.rc2) + actionmailer (= 3.2.0.rc2) + actionpack (= 3.2.0.rc2) + activerecord (= 3.2.0.rc2) + activeresource (= 3.2.0.rc2) + activesupport (= 3.2.0.rc2) bundler (~> 1.0) - railties (= 3.0.4) - railties (3.0.4) - actionpack (= 3.0.4) - activesupport (= 3.0.4) + railties (= 3.2.0.rc2) + railties (3.2.0.rc2) + actionpack (= 3.2.0.rc2) + activesupport (= 3.2.0.rc2) + rack-ssl (~> 1.3.2) rake (>= 0.8.7) - thor (~> 0.14.4) - rake (0.8.7) - rspec (2.5.0) - rspec-core (~> 2.5.0) - rspec-expectations (~> 2.5.0) - rspec-mocks (~> 2.5.0) - rspec-core (2.5.1) - rspec-expectations (2.5.0) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2.2) + rdoc (3.12) + json (~> 1.4) + rspec (2.8.0) + rspec-core (~> 2.8.0) + rspec-expectations (~> 2.8.0) + rspec-mocks (~> 2.8.0) + rspec-core (2.8.0) + rspec-expectations (2.8.0) diff-lcs (~> 1.1.2) - rspec-mocks (2.5.0) - rspec-rails (2.5.0) - actionpack (~> 3.0) - activesupport (~> 3.0) - railties (~> 3.0) - rspec (~> 2.5.0) + rspec-mocks (2.8.0) + rspec-rails (2.8.1) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec (~> 2.8.0) ruby-openid (2.1.8) - sqlite3 (1.3.3) + rubyzip (0.9.5) + sass (3.1.12) + sass-rails (3.2.3) + railties (~> 3.2.0.beta) + sass (>= 3.1.10) + tilt (~> 1.3) + selenium-webdriver (2.17.0) + childprocess (>= 0.2.5) + ffi (~> 1.0.9) + multi_json (~> 1.0.4) + rubyzip + sprockets (2.1.2) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.5) sqlite3-ruby (1.3.3) sqlite3 (>= 1.3.3) - term-ansicolor (1.0.5) + term-ansicolor (1.0.7) thor (0.14.6) - treetop (1.4.9) + tilt (1.3.3) + treetop (1.4.10) + polyglot polyglot (>= 0.3.1) - trinidad (1.2.3) - jruby-rack (>= 1.0.9) + trinidad (1.3.2) + jruby-rack (>= 1.1.1) trinidad_jars (>= 1.0.1) - trinidad_jars (1.0.1) - tzinfo (0.3.24) + trinidad_jars (1.0.2) + tzinfo (0.3.31) webrat (0.7.3) nokogiri (>= 1.2.0) rack (>= 1.0) rack-test (>= 0.5.3) - will_paginate (3.0.pre2) + will_paginate (3.0.2) + xpath (0.1.4) + nokogiri (~> 1.3) PLATFORMS java ruby DEPENDENCIES - RedCloth (~> 4.2.7) + RedCloth (~> 4.2.9) aaronh-chronic activerecord-jdbcsqlite3-adapter coderay + coffee-rails (~> 3.2.1) cucumber-rails factory_girl formtastic @@ -145,11 +194,12 @@ DEPENDENCIES lesstile nokogiri (~> 1.5.0) rack-openid - rails (= 3.0.4) + rails (= 3.2.0.rc2) rspec rspec-rails ruby-openid + sass-rails (~> 3.2.3) sqlite3-ruby trinidad webrat - will_paginate (= 3.0.pre2) + will_paginate (~> 3.0.2) diff --git a/Rakefile b/Rakefile index f706cfa..6cd7755 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ +#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) -require 'rake' Enki::Application.load_tasks diff --git a/app/helpers/url_helper.rb b/app/helpers/url_helper.rb index 21c63cc..08eebdb 100644 --- a/app/helpers/url_helper.rb +++ b/app/helpers/url_helper.rb @@ -6,7 +6,7 @@ def post_path(post, options = {}) path end - def post_comments_path(post) + def post_comments_path(post, comment) post_path(post) + "/comments" end diff --git a/app/models/post.rb b/app/models/post.rb index eb38480..cb057de 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -89,8 +89,9 @@ def find_all_grouped_by_month def destroy_with_undo transaction do + undo = DeletePostUndo.create_undo(self) self.destroy - return DeletePostUndo.create_undo(self) + return undo end end diff --git a/config/application.rb b/config/application.rb index 48a4566..3b02f85 100644 --- a/config/application.rb +++ b/config/application.rb @@ -1,15 +1,24 @@ require File.expand_path('../boot', __FILE__) -require 'rails/all' +# Pick the frameworks you want: +require "active_record/railtie" +require "action_controller/railtie" +require "action_mailer/railtie" +require "active_resource/railtie" +require "sprockets/railtie" +# require "rails/test_unit/railtie" # Bundler 1.0.10 incorrectly activates the new experimental Psych YAML parser # in 1.9.2, which breaks on RedCloth. This hack reverts it, but can be removed # once it is all sorted out. The const_defined check is required for 1.8.7 compat. YAML::ENGINE.yamler = "syck" if YAML.const_defined?("ENGINE") -# If you have a Gemfile, require the gems listed there, including any gems -# you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) +if defined?(Bundler) + # If you precompile assets before deploying to production, use this line + Bundler.require(*Rails.groups(:assets => %w(development test))) + # If you want your assets lazily compiled in production, use this line + # Bundler.require(:default, :assets, Rails.env) +end module Enki class Application < Rails::Application @@ -35,13 +44,27 @@ class Application < Rails::Application # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de - # JavaScript files you want as :defaults (application.js is always included). - config.action_view.javascript_expansions[:defaults] = %w() - # Configure the default encoding used in templates for Ruby 1.9. config.encoding = "utf-8" # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password] + + # Use SQL instead of Active Record's schema dumper when creating the database. + # This is necessary if your schema can't be completely dumped by the schema dumper, + # like if you have constraints or database-specific column types + # config.active_record.schema_format = :sql + + # Enforce whitelist mode for mass assignment. + # This will create an empty whitelist of attributes available for mass-assignment for all models + # in your app. As such, your models will need to explicitly whitelist or blacklist accessible + # parameters by using an attr_accessible or attr_protected declaration. + # config.active_record.whitelist_attributes = true + + # Enable the asset pipeline + config.assets.enabled = true + + # Version of your assets, change this if you want to expire all your assets + config.assets.version = '1.0' end end diff --git a/config/boot.rb b/config/boot.rb index ab6cb37..4489e58 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,13 +1,6 @@ require 'rubygems' # Set up gems listed in the Gemfile. -gemfile = File.expand_path('../../Gemfile', __FILE__) -begin - ENV['BUNDLE_GEMFILE'] = gemfile - require 'bundler' - Bundler.setup -rescue Bundler::GemNotFound => e - STDERR.puts e.message - STDERR.puts "Try running `bundle install`." - exit! -end if File.exist?(gemfile) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) + +require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) diff --git a/config/environments/development.rb b/config/environments/development.rb index fcce127..82c373a 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,9 +1,9 @@ Enki::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the webserver when you make code changes. + # every request. This slows down response time but is perfect for development + # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. @@ -11,7 +11,6 @@ # Show full error reports and disable caching config.consider_all_requests_local = true - config.action_view.debug_rjs = true config.action_controller.perform_caching = false # Don't care if the mailer can't send @@ -22,5 +21,12 @@ # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin + + + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index 2124674..1cf0903 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,7 +1,6 @@ Enki::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb - # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true @@ -9,31 +8,46 @@ config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Specifies the header that your server uses for sending files - config.action_dispatch.x_sendfile_header = "X-Sendfile" + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false + + # Compress JavaScripts and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline if a precompiled asset is missed + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + + # Defaults to Rails.root.join("public/assets") + # config.assets.manifest = YOUR_PATH - # For nginx: - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' + # Specifies the header that your server uses for sending files + # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx - # If you have no front-end server that supports something like X-Sendfile, - # just comment this out and Rails will serve the files + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true # See everything in the log (default is :info) # config.log_level = :debug + # Prepend all log lines with the following tags + # config.log_tags = [ :subdomain, :uuid ] + # Use a different logger for distributed setups - # config.logger = SyslogLogger.new + # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) # Use a different cache store in production # config.cache_store = :mem_cache_store - # Disable Rails's static asset server - # In production, Apache or nginx will already do this - config.serve_static_assets = false - - # Enable serving of images, stylesheets, and javascripts from an asset server + # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false @@ -46,4 +60,5 @@ # Send deprecation notices to registered listeners config.active_support.deprecation = :notify + end diff --git a/config/environments/test.rb b/config/environments/test.rb index c435161..caa69d3 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,13 +1,17 @@ Enki::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb + # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that + # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! + # and recreated between test runs. Don't rely on the data there! config.cache_classes = true - # Log error messages when you accidentally call methods on nil. + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil config.whiny_nils = true # Show full error reports and disable caching @@ -25,10 +29,6 @@ # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test - # Use SQL instead of Active Record's schema dumper when creating the test database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql # Print deprecation notices to the stderr config.active_support.deprecation = :stderr diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 9e8b013..5d8d9be 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -8,3 +8,8 @@ # inflect.irregular 'person', 'people' # inflect.uncountable %w( fish sheep ) # end +# +# These inflection rules are supported but not enabled by default: +# ActiveSupport::Inflector.inflections do |inflect| +# inflect.acronym 'RESTful' +# end diff --git a/config/initializers/new_rails_defaults.rb b/config/initializers/new_rails_defaults.rb deleted file mode 100644 index 8ec3186..0000000 --- a/config/initializers/new_rails_defaults.rb +++ /dev/null @@ -1,19 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# These settings change the behavior of Rails 2 apps and will be defaults -# for Rails 3. You can remove this initializer when Rails 3 is released. - -if defined?(ActiveRecord) - # Include Active Record class name as root for JSON serialized output. - ActiveRecord::Base.include_root_in_json = true - - # Store the full class name (including module namespace) in STI type column. - ActiveRecord::Base.store_full_sti_class = true -end - -# Use ISO 8601 format for JSON serialized times and dates. -ActiveSupport.use_standard_json_time_format = true - -# Don't escape HTML entities in JSON, leave that for the #json_escape helper. -# if you're including raw json in an HTML page. -ActiveSupport.escape_html_entities_in_json = false \ No newline at end of file diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index cbe0b54..78df098 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,8 +1,8 @@ # Be sure to restart your server when you modify this file. -Enki::Application.config.session_store :cookie_store, :key => '_enki_session' +Enki::Application.config.session_store :cookie_store, key: '_enki_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information -# (create the session table with "rake db:sessions:create") -# Enki::Application.config.session_store :active_record_store +# (create the session table with "rails generate session_migration") +# CodeConcoction::Application.config.session_store :active_record_store diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..369b465 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,10 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActiveSupport.on_load(:action_controller) do + wrap_parameters format: [:json] +end + diff --git a/spec/support/be_valid_html5.rb b/spec/support/be_valid_html5.rb index dc531a9..91bc155 100644 --- a/spec/support/be_valid_html5.rb +++ b/spec/support/be_valid_html5.rb @@ -34,8 +34,8 @@ def initialize(base, options) @@auto_validate = false cattr_accessor :auto_validate - class_inheritable_accessor :auto_validate_excludes - class_inheritable_accessor :auto_validate_includes + class_attribute :auto_validate_excludes + class_attribute :auto_validate_includes def matches?(rendered) diff --git a/spec/support/be_valid_xhtml.rb b/spec/support/be_valid_xhtml.rb index e576f14..428e2ae 100644 --- a/spec/support/be_valid_xhtml.rb +++ b/spec/support/be_valid_xhtml.rb @@ -31,8 +31,8 @@ def initialize(options) @@auto_validate = false cattr_accessor :auto_validate - class_inheritable_accessor :auto_validate_excludes - class_inheritable_accessor :auto_validate_includes + class_attribute :auto_validate_excludes + class_attribute :auto_validate_includes def matches?(rendered) diff --git a/spec/views/admin/comments/index.html.erb_spec.rb b/spec/views/admin/comments/index.html_spec.rb similarity index 82% rename from spec/views/admin/comments/index.html.erb_spec.rb rename to spec/views/admin/comments/index.html_spec.rb index 9c5037e..c55a518 100644 --- a/spec/views/admin/comments/index.html.erb_spec.rb +++ b/spec/views/admin/comments/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/comments/index.html.erb" do +describe "/admin/comments/index.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -18,6 +18,6 @@ )] comments.stub!(:total_pages).and_return(1) assign :comments, comments - render :template => '/admin/comments/index.html.erb' + render :template => '/admin/comments/index', :formats => [:html] end end diff --git a/spec/views/admin/comments/show.html.erb_spec.rb b/spec/views/admin/comments/show.html_spec.rb similarity index 86% rename from spec/views/admin/comments/show.html.erb_spec.rb rename to spec/views/admin/comments/show.html_spec.rb index 9640912..469c003 100644 --- a/spec/views/admin/comments/show.html.erb_spec.rb +++ b/spec/views/admin/comments/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/comments/show.html.erb" do +describe "/admin/comments/show.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -19,6 +19,6 @@ :slug => 'a-post', :published_at => Time.now )) - render :template => '/admin/comments/show.html.erb' + render :template => '/admin/comments/show', :formats => [:html] end end diff --git a/spec/views/admin/dashboard/show.html.erb_spec.rb b/spec/views/admin/dashboard/show.html_spec.rb similarity index 89% rename from spec/views/admin/dashboard/show.html.erb_spec.rb rename to spec/views/admin/dashboard/show.html_spec.rb index b49bfda..9fba451 100644 --- a/spec/views/admin/dashboard/show.html.erb_spec.rb +++ b/spec/views/admin/dashboard/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/dashboard/show.html.erb" do +describe "/admin/dashboard/show.html" do before(:each) do view.stub!(:enki_config).and_return(Enki::Config.default) end @@ -27,6 +27,6 @@ :most_recent_comment => mock_model(Comment, :created_at => Time.now, :author => 'Don') )] assign :stats, Struct.new(:post_count, :comment_count, :tag_count).new(3,2,1) - render :template => '/admin/dashboard/show.html.erb' + render :template => '/admin/dashboard/show', :formats => [:html] end end diff --git a/spec/views/admin/pages/index.html.erb_spec.rb b/spec/views/admin/pages/index.html_spec.rb similarity index 79% rename from spec/views/admin/pages/index.html.erb_spec.rb rename to spec/views/admin/pages/index.html_spec.rb index 85261a0..823efba 100644 --- a/spec/views/admin/pages/index.html.erb_spec.rb +++ b/spec/views/admin/pages/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/pages/index.html.erb" do +describe "/admin/pages/index.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -14,6 +14,6 @@ )] pages.stub!(:total_pages).and_return(1) assign :pages, pages - render :template => '/admin/pages/index.html.erb' + render :template => '/admin/pages/index', :formats => [:html] end end diff --git a/spec/views/admin/pages/new.html.erb_spec.rb b/spec/views/admin/pages/new.html_spec.rb similarity index 65% rename from spec/views/admin/pages/new.html.erb_spec.rb rename to spec/views/admin/pages/new.html_spec.rb index 5c1b0d8..f8ffd38 100644 --- a/spec/views/admin/pages/new.html.erb_spec.rb +++ b/spec/views/admin/pages/new.html_spec.rb @@ -1,12 +1,12 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/pages/new.html.erb" do +describe "/admin/pages/new.html" do after(:each) do rendered.should be_valid_html5_fragment end it 'should render' do assign :page, Page.new - render :template => '/admin/pages/new.html.erb' + render :template => '/admin/pages/new', :formats => [:html] end end diff --git a/spec/views/admin/pages/show.html.erb_spec.rb b/spec/views/admin/pages/show.html_spec.rb similarity index 73% rename from spec/views/admin/pages/show.html.erb_spec.rb rename to spec/views/admin/pages/show.html_spec.rb index 73ad907..469f142 100644 --- a/spec/views/admin/pages/show.html.erb_spec.rb +++ b/spec/views/admin/pages/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/pages/show.html.erb" do +describe "/admin/pages/show.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -11,6 +11,6 @@ :created_at => Time.now, :slug => 'a-page' ) - render :template => '/admin/pages/show.html.erb' + render :template => '/admin/pages/show', :formats => [:html] end end diff --git a/spec/views/admin/posts/index.html.erb_spec.rb b/spec/views/admin/posts/index.html_spec.rb similarity index 81% rename from spec/views/admin/posts/index.html.erb_spec.rb rename to spec/views/admin/posts/index.html_spec.rb index b291571..04292f5 100644 --- a/spec/views/admin/posts/index.html.erb_spec.rb +++ b/spec/views/admin/posts/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/posts/index.html.erb" do +describe "/admin/posts/index.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -15,6 +15,6 @@ )] posts.stub!(:total_pages).and_return(1) assign :posts, posts - render :template => '/admin/posts/index.html.erb' + render :template => '/admin/posts/index', :formats => [:html] end end diff --git a/spec/views/admin/posts/new.html.erb_spec.rb b/spec/views/admin/posts/new.html_spec.rb similarity index 65% rename from spec/views/admin/posts/new.html.erb_spec.rb rename to spec/views/admin/posts/new.html_spec.rb index ba7e3cc..eb94447 100644 --- a/spec/views/admin/posts/new.html.erb_spec.rb +++ b/spec/views/admin/posts/new.html_spec.rb @@ -1,12 +1,12 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/posts/new.html.erb" do +describe "/admin/posts/new.html" do after(:each) do rendered.should be_valid_html5_fragment end it 'should render' do assign :post, Post.new - render :template => '/admin/posts/new.html.erb' + render :template => '/admin/posts/new', :formats => [:html] end end diff --git a/spec/views/admin/posts/show.html.erb_spec.rb b/spec/views/admin/posts/show.html_spec.rb similarity index 74% rename from spec/views/admin/posts/show.html.erb_spec.rb rename to spec/views/admin/posts/show.html_spec.rb index 1586839..0bda835 100644 --- a/spec/views/admin/posts/show.html.erb_spec.rb +++ b/spec/views/admin/posts/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/posts/show.html.erb" do +describe "/admin/posts/show.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -11,6 +11,6 @@ :published_at => Time.now, :slug => 'a-post' ) - render :template => '/admin/posts/show.html.erb' + render :template => '/admin/posts/show', :formats => [:html] end end diff --git a/spec/views/admin/sessions/new.html.erb_spec.rb b/spec/views/admin/sessions/new.html_spec.rb similarity index 71% rename from spec/views/admin/sessions/new.html.erb_spec.rb rename to spec/views/admin/sessions/new.html_spec.rb index 65e9a5a..d1a84f2 100644 --- a/spec/views/admin/sessions/new.html.erb_spec.rb +++ b/spec/views/admin/sessions/new.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/sessions/new.html.erb" do +describe "/admin/sessions/new.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -8,6 +8,6 @@ it "renders" do view.stub!(:enki_config).and_return(Enki::Config.default) view.stub!(:allow_login_bypass?).and_return(true) - render :template => '/admin/sessions/new.html.erb' + render :template => '/admin/sessions/new', :formats => [:html] end end diff --git a/spec/views/admin/undo_items/index.html.erb_spec.rb b/spec/views/admin/undo_items/index.html_spec.rb similarity index 71% rename from spec/views/admin/undo_items/index.html.erb_spec.rb rename to spec/views/admin/undo_items/index.html_spec.rb index f2347d2..927965b 100644 --- a/spec/views/admin/undo_items/index.html.erb_spec.rb +++ b/spec/views/admin/undo_items/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../../spec_helper' -describe "/admin/undo_items/index.html.erb" do +describe "/admin/undo_items/index.html" do after(:each) do rendered.should be_valid_html5_fragment end @@ -10,6 +10,6 @@ :created_at => Time.now, :description => 'Deleted a comment' )] - render :template => '/admin/undo_items/index.html.erb' + render :template => '/admin/undo_items/index', :formats => [:html] end end diff --git a/spec/views/archives/index.html.erb_spec.rb b/spec/views/archives/index.html_spec.rb similarity index 90% rename from spec/views/archives/index.html.erb_spec.rb rename to spec/views/archives/index.html_spec.rb index 742e24a..2bcd3e0 100644 --- a/spec/views/archives/index.html.erb_spec.rb +++ b/spec/views/archives/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/archives/index.html.erb" do +describe "/archives/index.html" do def tag(name) mock_model(Tag, :name => name) end @@ -25,6 +25,6 @@ def tag(name) end it 'renders posts grouped by month' do - render :template => "/archives/index.html.erb" + render :template => "/archives/index", :formats => [:html] end end diff --git a/spec/views/layouts/login.html.erb_spec.rb b/spec/views/layouts/admin.html_spec.rb similarity index 60% rename from spec/views/layouts/login.html.erb_spec.rb rename to spec/views/layouts/admin.html_spec.rb index 56fc88c..84675d9 100644 --- a/spec/views/layouts/login.html.erb_spec.rb +++ b/spec/views/layouts/admin.html_spec.rb @@ -1,8 +1,8 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/layouts/login.html.erb" do +describe "/layouts/admin.html" do it 'renders' do view.stub!(:enki_config).and_return(Enki::Config.default) - render :template => '/layouts/login.html.erb' + render :template => '/layouts/admin', :formats => [:html] end end diff --git a/spec/views/layouts/application.html.erb_spec.rb b/spec/views/layouts/application.html_spec.rb similarity index 81% rename from spec/views/layouts/application.html.erb_spec.rb rename to spec/views/layouts/application.html_spec.rb index c2381e9..cbc4cc2 100644 --- a/spec/views/layouts/application.html.erb_spec.rb +++ b/spec/views/layouts/application.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/layouts/application.html.erb" do +describe "/layouts/application.html" do before(:each) do view.stub!(:enki_config).and_return(Enki::Config.default) @@ -18,6 +18,6 @@ end it 'renders' do - render :template => '/layouts/application.html.erb' + render :template => '/layouts/application', :formats => [:html] end end diff --git a/spec/views/layouts/admin.html.erb_spec.rb b/spec/views/layouts/login.html_spec.rb similarity index 60% rename from spec/views/layouts/admin.html.erb_spec.rb rename to spec/views/layouts/login.html_spec.rb index 07b1e69..95172f9 100644 --- a/spec/views/layouts/admin.html.erb_spec.rb +++ b/spec/views/layouts/login.html_spec.rb @@ -1,8 +1,8 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/layouts/admin.html.erb" do +describe "/layouts/login.html" do it 'renders' do view.stub!(:enki_config).and_return(Enki::Config.default) - render :template => '/layouts/admin.html.erb' + render :template => '/layouts/login', :formats => [:html] end end diff --git a/spec/views/pages/show.html.erb_spec.rb b/spec/views/pages/show.html_spec.rb similarity index 83% rename from spec/views/pages/show.html.erb_spec.rb rename to spec/views/pages/show.html_spec.rb index 6a3af7b..0fc170f 100644 --- a/spec/views/pages/show.html.erb_spec.rb +++ b/spec/views/pages/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/pages/show.html.erb" do +describe "/pages/show.html" do include UrlHelper before(:each) do @@ -19,6 +19,6 @@ end it "should render a page" do - render :template => "/pages/show.html.erb" + render :template => "/pages/show", :formats => [:html] end end diff --git a/spec/views/posts/index.atom.builder_spec.rb b/spec/views/posts/index.atom.builder_spec.rb index 9193e8b..becc37e 100644 --- a/spec/views/posts/index.atom.builder_spec.rb +++ b/spec/views/posts/index.atom.builder_spec.rb @@ -22,11 +22,11 @@ end it "should render list of posts" do - render :template => "/posts/index.atom.builder" + render :template => "/posts/index", :formats => [:atom], :handler => [:builder] end it "should render list of posts with a tag" do assigns[:tag] = 'code' - render :template => "/posts/index.atom.builder" + render :template => "/posts/index", :formats => [:atom], :handler => [:builder] end end diff --git a/spec/views/posts/index.html.erb_spec.rb b/spec/views/posts/index.html_spec.rb similarity index 82% rename from spec/views/posts/index.html.erb_spec.rb rename to spec/views/posts/index.html_spec.rb index de18273..aa881c8 100644 --- a/spec/views/posts/index.html.erb_spec.rb +++ b/spec/views/posts/index.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/posts/index.html.erb" do +describe "/posts/index.html" do before(:each) do view.stub!(:enki_config).and_return(Enki::Config.default) @@ -25,11 +25,11 @@ end it "should render list of posts" do - render :template => "/posts/index.html.erb" + render :template => "/posts/index", :formats => [:html] end it "should render list of posts with a tag" do assigns[:tag] = 'code' - render :template => "/posts/index.html.erb" + render :template => "/posts/index", :formats => [:html] end end diff --git a/spec/views/posts/show.html.erb_spec.rb b/spec/views/posts/show.html_spec.rb similarity index 93% rename from spec/views/posts/show.html.erb_spec.rb rename to spec/views/posts/show.html_spec.rb index 433d430..5ddaae2 100644 --- a/spec/views/posts/show.html.erb_spec.rb +++ b/spec/views/posts/show.html_spec.rb @@ -1,6 +1,6 @@ require File.dirname(__FILE__) + '/../../spec_helper' -describe "/posts/show.html.erb" do +describe "/posts/show.html" do include UrlHelper before(:each) do @@ -42,6 +42,6 @@ end it "should render a post" do - render :template => "/posts/show.html.erb" + render :template => "/posts/show", :formats => [:html] end end