vendor/plugins/rspec_on_rails_on_crack/lib/rspec_on_rails_on_crack/controller_example_group_methods.rb
# Creates 3 examples: One to check that the given template was rendered.
# It looks for two options: :status and :format.
#
#   it_renders :template, :index
#   it_renders :template, :index, :status => :not_found
#   it_renders :template, :index, :format => :xml
#
# If :status is unset, it checks that that the response was a success.
# Otherwise it takes an integer or a symbol and matches the status code.
#
# If :format is unset, it checks that the action is Mime:HTML.  Otherwise
# it attempts to match the mime type using Mime::Type.lookup_by_extension.
#
Creates 3 examples: One to check that the given template was rendered.
It looks for two options: :status and :format.



If :status is unset, it checks that that the response was a success.
Otherwise it takes an integer or a symbol and matches the status code.

If :format is unset, it checks that the action is Mime:HTML.  Otherwise
it attempts to match the mime type using Mime::Type.lookup_by_extension.
Creates 3 examples : One to check that the given template was rendered . It looks for two options : : status and : format . If : status is unset it checks that that the response was a success . Otherwise it takes an integer or a symbol and matches the status code . If : format is unset it checks that the action is Mime : HTML . Otherwise it attempts to match the mime type using Mime :: Type . lookup_by_extension .
def it_renders_template(template_name, options = {})
      it "renders #{template_name}" do
        integration = lambda { @controller.integrate_views! }
        unless options[:pending]
          @controller.integrate_views!
        end
        acting do |response|
          asserts_status options[:status]
          asserts_content_type options[:format]
          response.should render_template(template_name.to_s)
        end
        if options[:pending]
          pending "Views are not integrated yet"
        end
      end
    end
def it_renders_template ( template_name , options = { } ) it "renders #{template_name}" do integration = lambda { @controller . integrate_views! } unless options [ :pending ] @controller . integrate_views! end acting do | response | asserts_status options [ :status ] asserts_content_type options [ :format ] response . should render_template ( template_name . to_s ) end if options [ :pending ] pending "Views are not integrated yet" end end end
Creates 3 examples: One to check that the given template was rendered.
Creates 3 examples : One to check that the given template was rendered .
template_name
options