Permalink
Browse files

add rails 3.0 support

  • Loading branch information...
1 parent 9197fb9 commit 8c22b3645eb574900cd81ccc2167b13217f96add @jonleighton jonleighton committed Feb 20, 2012
View
@@ -6,6 +6,7 @@ rvm:
gemfile:
- gemfiles/rails-3-2.gemfile
- gemfiles/rails-3-1.gemfile
+ - gemfiles/rails-3-0.gemfile
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
View
@@ -5,3 +5,7 @@ end
appraise 'rails-3-1' do
gem 'rails', '~> 3.1.0'
end
+
+appraise 'rails-3-0' do
+ gem 'rails', '~> 3.0.0'
+end
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency 'actionpack', '~> 3.1'
+ s.add_dependency 'actionpack', '~> 3.0'
s.add_development_dependency 'minitest', '~> 2.11.2'
s.add_development_dependency 'capybara', '~> 1.1.2'
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "rails", "~> 3.0.0"
+
+gemspec :path=>"../"
@@ -1,5 +1,3 @@
class ApplicationController < ActionController::Base
- protect_from_forgery
-
include FocusedController::Mixin
end
@@ -4,7 +4,6 @@
<title>App</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
</head>
<body>
@@ -3,12 +3,7 @@
require 'action_controller/railtie'
require 'rails/test_unit/railtie'
-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
+Bundler.require
module App
class Application < Rails::Application
@@ -1,14 +0,0 @@
-# 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
-
-# Disable root element in JSON by default.
-ActiveSupport.on_load(:active_record) do
- self.include_root_in_json = false
-end
@@ -31,28 +31,28 @@
describe PostsController::Show do
it "should show post" do
- get :id => @post
+ get :id => @post.id
response.should be_success
end
end
describe PostsController::Edit do
it "should get edit" do
- get :id => @post
+ get :id => @post.id
response.should be_success
end
end
describe PostsController::Update do
it "should update post" do
- put :id => @post, :post => @post.attributes
+ put :id => @post.id, :post => @post.attributes
response.should redirect_to(post_path(subject.post))
end
end
describe PostsController::Destroy do
it "should destroy post" do
- expect { delete :id => @post }.to change(Post, :count).by(-1)
+ expect { delete :id => @post.id }.to change(Post, :count).by(-1)
response.should redirect_to(posts_path)
end
end
@@ -36,29 +36,29 @@ class CreateTest < TestCase
class ShowTest < TestCase
test "should show post" do
- get :id => @post
+ get :id => @post.id
assert_response :success
end
end
class EditTest < TestCase
test "should get edit" do
- get :id => @post
+ get :id => @post.id
assert_response :success
end
end
class UpdateTest < TestCase
test "should update post" do
- put :id => @post, :post => @post.attributes
+ put :id => @post.id, :post => @post.attributes
assert_redirected_to post_path(@controller.post)
end
end
class DestroyTest < TestCase
test "should destroy post" do
assert_difference('Post.count', -1) do
- delete :id => @post
+ delete :id => @post.id
end
assert_redirected_to posts_path
View
@@ -28,6 +28,6 @@ def self.root
end
def self.application
- OpenStruct.new(:env_config => {})
+ OpenStruct.new(:env_config => {}, :env_defaults => {})
end
end

0 comments on commit 8c22b36

Please sign in to comment.