diff --git a/spec/generators/views_generator_spec.rb b/spec/generators/views_generator_spec.rb index 02870d9..da1ca3c 100644 --- a/spec/generators/views_generator_spec.rb +++ b/spec/generators/views_generator_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -if defined?(Rails) +if defined?(::Rails::Railtie) require 'rails/generators' require 'generators/kaminari/views_generator' diff --git a/spec/helpers/action_view_extension_spec.rb b/spec/helpers/action_view_extension_spec.rb index 415c659..16b5ee6 100644 --- a/spec/helpers/action_view_extension_spec.rb +++ b/spec/helpers/action_view_extension_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'Kaminari::ActionViewExtension', :if => defined?(Rails) do +describe 'Kaminari::ActionViewExtension', :if => defined?(::Rails::Railtie) do describe '#paginate' do before do 50.times {|i| User.create! :name => "user#{i}"} diff --git a/spec/helpers/tags_spec.rb b/spec/helpers/tags_spec.rb index f8c53ef..6092788 100644 --- a/spec/helpers/tags_spec.rb +++ b/spec/helpers/tags_spec.rb @@ -3,7 +3,7 @@ include Kaminari::Helpers describe 'Kaminari::Helpers' do describe 'Tag' do - describe '#page_url_for', :if => defined?(Rails) do + describe '#page_url_for', :if => defined?(::Rails::Railtie) do before do helper.params[:controller] = 'users' helper.params[:action] = 'index' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ab9cd41..e56c315 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,7 +15,7 @@ require 'database_cleaner' # Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded. require 'fake_gem' if defined? ActiveRecord -if defined? Rails +if defined? ::Rails::Railtie require 'fake_app/rails_app' require 'rspec/rails'