Permalink
Browse files

Rails 4 test compatibility

  • Loading branch information...
1 parent 72b0f13 commit 738b27b6b606af7cbdaaf7ac60a2fccdd13a5fd9 @mislav committed Nov 23, 2012
@@ -207,7 +207,7 @@
sql = "select content from topics where content like '%futurama%'"
topics = Topic.paginate_by_sql sql, :page => 1, :per_page => 1
topics.total_entries.should == 1
- topics.first['title'].should be_nil
+ topics.first.attributes.has_key?('title').should be_false
}.should run_queries(2)
end
@@ -30,7 +30,9 @@ module ActiverecordTestConnector
FIXTURES_PATH = File.expand_path('../../fixtures', __FILE__)
- Fixtures = defined?(ActiveRecord::Fixtures) ? ActiveRecord::Fixtures : ::Fixtures
+ Fixtures = defined?(ActiveRecord::FixtureSet) ? ActiveRecord::FixtureSet :
+ defined?(ActiveRecord::Fixtures) ? ActiveRecord::Fixtures :
+ ::Fixtures
# Set our defaults
self.connected = false
@@ -1,5 +1,5 @@
class Developer < User
- has_and_belongs_to_many :projects, :include => :topics, :order => 'projects.name'
+ has_and_belongs_to_many :projects, :include => :topics, :order => 'projects.name', :join_table => 'developers_projects'
def self.with_poor_ones(&block)
with_scope :find => { :conditions => ['salary <= ?', 80000], :order => 'salary' } do
View
@@ -1,5 +1,5 @@
class Project < ActiveRecord::Base
- has_and_belongs_to_many :developers, :uniq => true
+ has_and_belongs_to_many :developers, :uniq => true, :join_table => 'developers_projects'
has_many :topics
# :finder_sql => 'SELECT * FROM topics WHERE (topics.project_id = #{id})',
@@ -7,12 +7,12 @@
Routes = ActionDispatch::Routing::RouteSet.new
Routes.draw do
- match 'dummy/page/:page' => 'dummy#index'
- match 'dummy/dots/page.:page' => 'dummy#dots'
- match 'ibocorp(/:page)' => 'ibocorp#index',
+ get 'dummy/page/:page' => 'dummy#index'
+ get 'dummy/dots/page.:page' => 'dummy#dots'
+ get 'ibocorp(/:page)' => 'ibocorp#index',
:constraints => { :page => /\d+/ }, :defaults => { :page => 1 }
- match ':controller(/:action(/:id(.:format)))'
+ get ':controller(/:action(/:id(.:format)))'
end
describe WillPaginate::ActionView do
@@ -1,10 +1,12 @@
require 'active_support'
+require 'minitest/unit'
require 'action_dispatch/testing/assertions'
require 'will_paginate/array'
module ViewExampleGroup
include ActionDispatch::Assertions::SelectorAssertions
+ include MiniTest::Assertions
def assert(value, message)
raise message unless value

0 comments on commit 738b27b

Please sign in to comment.