Sha256: 972d18059ddc28ac824b546673f706402dbb50bbaeb80b057b7acee0fb93a4b4

Contents?: true

Size: 1.94 KB

Versions: 11

Compression:

Stored size: 1.94 KB

Contents

require "spec_helper"

module RSpec::Rails
  describe ViewRendering do
    it "doesn't render views by default" do
      rendering_views = nil
      group = RSpec::Core::ExampleGroup.describe do
        include ControllerExampleGroup
        rendering_views = render_views?
        it("does something") {}
      end
      group.run(double.as_null_object)
      rendering_views.should be_false
    end

    it "doesn't render views by default in a nested group" do
      rendering_views = nil
      group = RSpec::Core::ExampleGroup.describe do
        include ControllerExampleGroup
        describe "nested" do
          rendering_views = render_views?
          it("does something") {}
        end
      end
      group.run(double.as_null_object)
      rendering_views.should be_false
    end

    it "renders views if told to" do
      rendering_views = false
      group = RSpec::Core::ExampleGroup.describe do
        include ControllerExampleGroup
        render_views
        rendering_views = render_views?
        it("does something") {}
      end
      group.run(double.as_null_object)
      rendering_views.should be_true
    end

    it "renders views if told to in a nested group" do
      rendering_views = nil
      group = RSpec::Core::ExampleGroup.describe do
        include ControllerExampleGroup
        describe "nested" do
          render_views
          rendering_views = render_views?
          it("does something") {}
        end
      end
      group.run(double.as_null_object)
      rendering_views.should be_true
    end

    it "renders views in a nested group if told to in an outer group" do
      rendering_views = nil
      group = RSpec::Core::ExampleGroup.describe do
        include ControllerExampleGroup
        render_views
        describe "nested" do
          rendering_views = render_views?
          it("does something") {}
        end
      end
      group.run(double.as_null_object)
      rendering_views.should be_true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rspec-rails-2.0.0.beta.19 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.18 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.17 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.16 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.15 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.14.2 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.14.1 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.13 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.12 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.11 spec/rspec/rails/example/view_rendering_spec.rb
rspec-rails-2.0.0.beta.10 spec/rspec/rails/example/view_rendering_spec.rb