Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

revert all changes for #539

- not ready for release so backing out
- changes are stored in engine-support branch
  • Loading branch information...
commit 603cf3dec2d649a7491db96b4274faac55ce927f 1 parent 91870ed
@dchelimsky dchelimsky authored
View
3  Changelog.md
@@ -7,9 +7,6 @@ Enhancements
specs run in random order by default.
* rename `render_template` to `have_rendered` (and alias to `render_template`
for backward compatibility)
-* Specify a different application (e.g. an engine) instead of the Rails app:
- `Rails.configuration.application = MyEngine` - default is `Rails.application`
- (Dan Rasband @danrasban)
Bug fixes
View
23 lib/rspec/rails.rb
@@ -1,23 +1,8 @@
require 'rspec/core'
-module RSpec
- module Rails
- def self.at_least_rails_3_1?
- Gem::Version.new(::Rails.version) >= Gem::Version.new('3.1.0')
- end
- end
-end
-
-RSpec.configure do |config|
- config.backtrace_clean_patterns << /vendor\//
- config.backtrace_clean_patterns << /lib\/rspec\/rails/
- config.add_setting :application, :default => ::Rails.application
-
- unless RSpec::Rails.at_least_rails_3_1?
- def config.application=(*)
- raise 'Setting the application is only supported on Rails 3.1 and above.'
- end
- end
+RSpec::configure do |c|
+ c.backtrace_clean_patterns << /vendor\//
+ c.backtrace_clean_patterns << /lib\/rspec\/rails/
end
require 'rspec/rails/extensions'
@@ -29,4 +14,4 @@ def config.application=(*)
require 'rspec/rails/module_inclusion'
require 'rspec/rails/example'
require 'rspec/rails/vendor/capybara'
-require 'rspec/rails/vendor/webrat'
+require 'rspec/rails/vendor/webrat'
View
2  lib/rspec/rails/example/controller_example_group.rb
@@ -120,7 +120,7 @@ def method_missing(method, *args, &block)
metadata[:type] = :controller
before do
- @routes = RSpec.configuration.application.routes
+ @routes = ::Rails.application.routes
ActionController::Base.allow_forgery_protection = false
end
end
View
2  lib/rspec/rails/example/mailer_example_group.rb
@@ -7,7 +7,7 @@ module MailerExampleGroup
included do
metadata[:type] = :mailer
- include RSpec.configuration.application.routes.url_helpers
+ include ::Rails.application.routes.url_helpers
options = ::Rails.configuration.action_mailer.default_url_options
options.each { |key, value| default_url_options[key] = value } if options
end
View
4 lib/rspec/rails/example/request_example_group.rb
@@ -9,14 +9,14 @@ module RequestExampleGroup
include ActionController::TemplateAssertions
def app
- RSpec.configuration.application
+ ::Rails.application
end
included do
metadata[:type] = :request
before do
- @routes = RSpec.configuration.application.routes
+ @routes = ::Rails.application.routes
end
end
end
View
2  lib/rspec/rails/example/routing_example_group.rb
@@ -12,7 +12,7 @@ module RoutingExampleGroup
metadata[:type] = :routing
before do
- @routes = RSpec.configuration.application.routes
+ @routes = ::Rails.application.routes
end
end
View
14 spec/rspec/rails/configuration_spec.rb
@@ -23,18 +23,4 @@
RSpec.configuration.render_views?.should be_true
end
end
-
- describe "#application" do
- it "returns Rails.application by default" do
- RSpec.configuration.application.should eq(::Rails.application)
- end
- end
-
- describe '#application=' do
- context 'for Rails 3.0', :unless => RSpec::Rails.at_least_rails_3_1? do
- it 'raises an error' do
- expect { RSpec.configuration.application = ::Rails.application }.to raise_error
- end
- end
- end
end
View
12 spec/rspec/rails/example/request_example_group_spec.rb
@@ -13,17 +13,5 @@ module RSpec::Rails
end
group.metadata[:type].should eq(:request)
end
-
- describe '#app' do
- it 'returns the RSpec.configuration.application' do
- group = RSpec::Core::ExampleGroup.describe do
- include RequestExampleGroup
- end
-
- example = group.new
-
- example.app.should eq(RSpec.configuration.application)
- end
- end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.