Sha256: 5c3f4da4383a9c2129a498482fa321e3b80acac1fa6a6b635dcdb9ddc1013a70

Contents?: true

Size: 990 Bytes

Versions: 29

Compression:

Stored size: 990 Bytes

Contents

Feature: render_template matcher

  The `render_template` matcher is used to specify that a request renders a
  given template.  It delegates to
  [`assert_template`](http://api.rubyonrails.org/classes/ActionController/TemplateAssertions.html#method-i-assert_template)

  It is available in controller specs (spec/controllers) and request
  specs (spec/requests).

  NOTE: use `redirect_to(:action => 'new')` for redirects, not `render_template`.

  Scenario: render_template with three possible options
    Given a file named "spec/controllers/gadgets_spec.rb" with:
      """
      require "spec_helper"

      describe GadgetsController do
        describe "GET #index" do
          subject { get :index }

          it { should render_template(:index) }
          it { should render_template("index") }
          it { should render_template("gadgets/index") }
        end
      end
      """
    When I run `rspec spec/controllers/gadgets_spec.rb`
    Then the examples should all pass

Version data entries

29 entries across 24 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
rspec-rails-2.11.4 features/matchers/render_template_matcher.feature
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/matchers/render_template_matcher.feature
rspec-rails-2.11.0 features/matchers/render_template_matcher.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/render_template_matcher.feature
rspec-rails-2.10.1 features/matchers/render_template_matcher.feature
rspec-rails-2.10.0 features/matchers/render_template_matcher.feature
rspec-rails-2.9.0 features/matchers/render_template_matcher.feature
rspec-rails-2.9.0.rc2 features/matchers/render_template_matcher.feature