Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rails 4 test compatibility

  • Loading branch information...
commit 738b27b6b606af7cbdaaf7ac60a2fccdd13a5fd9 1 parent 72b0f13
@mislav authored
View
2  spec/finders/active_record_spec.rb
@@ -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
View
4 spec/finders/activerecord_test_connector.rb
@@ -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
View
2  spec/fixtures/developer.rb
@@ -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
2  spec/fixtures/project.rb
@@ -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})',
View
8 spec/view_helpers/action_view_spec.rb
@@ -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
View
2  spec/view_helpers/view_example_group.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.