Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 41 lines (33 sloc) 0.966 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
require "spec_helper"

describe "configuration" do
  before do
    @orig_render_views = RSpec.configuration.render_views?
  end

  after do
    RSpec.configuration.render_views = @orig_render_views
  end

  describe "#render_views?" do
    it "is false by default" do
      RSpec.configuration.render_views?.should be_false
    end
  end

  describe "#render_views" do
    it "sets render_views? to return true" do
      RSpec.configuration.render_views = false
      RSpec.configuration.render_views

      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', :not_at_least_rails_3_1 do
      it 'raises an error' do
        expect { RSpec.configuration.application = ::Rails.application }.to raise_error
      end
    end
  end
end
Something went wrong with that request. Please try again.